prevent announcement when description contains !private
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m43s

This commit is contained in:
Sammy 2023-06-23 15:56:36 +02:00
parent 31e440434e
commit 45d87275bf

View File

@ -20,6 +20,10 @@ export async function execute(event: GuildScheduledEvent) {
if (event.description.includes("!wp")) {
logger.info("Got manual create event of watchparty event!", { guildId, requestId })
if(event.description.includes("!private")) {
logger.info("Event description contains \"!private\". Won't announce.", { guildId, requestId })
return
}
const channel: Maybe<TextChannel> = client.getAnnouncementChannelForGuild(guildId)
@ -32,7 +36,7 @@ export async function execute(event: GuildScheduledEvent) {
channel.send(message)
} else {
logger.debug("Got GuildScheduledEventCreate event but no !wp in description. Not creating manual wp announcement.")
logger.debug("Got GuildScheduledEventCreate event but no !wp in description. Not creating manual wp announcement.", { guildId, requestId })
}
} catch (error) {