add early abort message to announce watch party

This commit is contained in:
kenobi 2023-07-13 22:45:28 +02:00
parent e8893646f0
commit ca19168cf4

View File

@ -32,7 +32,11 @@ export async function execute(event: GuildScheduledEvent) {
return
}
const message = `[Watchparty] https://discord.com/events/${event.guildId}/${event.id} \nHey <@&${config.bot.announcement_role}>, wir gucken ${event.name} ${createDateStringFromEvent(event, guildId, requestId)}`
if (!event.scheduledStartAt) {
logger.error('Event has no start date, bailing out')
return
}
const message = `[Watchparty] https://discord.com/events/${event.guildId}/${event.id} \nHey <@&${config.bot.announcement_role}>, wir gucken ${event.name} ${createDateStringFromEvent(event.scheduledStartAt, guildId, requestId)}`
channel.send(message)
} else {