From 9981143f87e665e7c9d209c41f00088839534a54 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sat, 26 Apr 2025 19:21:24 +0200 Subject: [PATCH] Fixed sending message to user without an event channel --- classes/pycord_bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/pycord_bot.py b/classes/pycord_bot.py index 4be5a39..ac489a0 100644 --- a/classes/pycord_bot.py +++ b/classes/pycord_bot.py @@ -145,6 +145,14 @@ class PycordBot(LibPycordBot): users: List[PycordUser] = await self._get_event_participants(event._id) for user in users: + if str(event._id) not in user.event_channels: + logger.warning( + "User %s participated in the event %s but did not have a channel. End message will not be sent and permissions will not be updated.", + user.id, + event._id, + ) + continue + # Send a notification about event start user_channel: TextChannel = guild.get_channel(user.event_channels[str(event._id)])