Added a message to admins when not stages are defined for the event to be started

This commit is contained in:
2025-04-26 19:05:15 +02:00
parent e6036d033e
commit 3e9edf91d5

View File

@@ -68,13 +68,20 @@ class PycordBot(LibPycordBot):
# Process each event
for event in events:
guild: Guild = self.get_guild(event.guild_id)
pycord_guild: PycordGuild = await self.find_guild(guild)
if len(event.stage_ids) == 0:
# TODO Make a nice message for management
logger.error("Could not start the event %s: no event stages are defined.", event._id)
continue
guild: Guild = self.get_guild(event.guild_id)
pycord_guild: PycordGuild = await self.find_guild(guild)
await self.notify_admins(
guild,
pycord_guild,
f"Could not start the event **{event.name}**: no event stages are defined.",
)
continue
first_stage: PycordEventStage = await self.find_event_stage(event.stage_ids[0])
# Get list of participants