Fixed sending message to user without an event channel
This commit is contained in:
@@ -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)])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user