Fixed sending message to user without an event channel

This commit is contained in:
2025-04-26 19:21:24 +02:00
parent 94c4cdbf65
commit 9981143f87

View File

@@ -145,6 +145,14 @@ class PycordBot(LibPycordBot):
users: List[PycordUser] = await self._get_event_participants(event._id) users: List[PycordUser] = await self._get_event_participants(event._id)
for user in users: 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 # Send a notification about event start
user_channel: TextChannel = guild.get_channel(user.event_channels[str(event._id)]) user_channel: TextChannel = guild.get_channel(user.event_channels[str(event._id)])