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)])