prevent announcement when description contains !private
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m43s
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m43s
This commit is contained in:
parent
31e440434e
commit
45d87275bf
@ -20,6 +20,10 @@ export async function execute(event: GuildScheduledEvent) {
|
|||||||
|
|
||||||
if (event.description.includes("!wp")) {
|
if (event.description.includes("!wp")) {
|
||||||
logger.info("Got manual create event of watchparty event!", { guildId, requestId })
|
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)
|
const channel: Maybe<TextChannel> = client.getAnnouncementChannelForGuild(guildId)
|
||||||
|
|
||||||
@ -32,7 +36,7 @@ export async function execute(event: GuildScheduledEvent) {
|
|||||||
|
|
||||||
channel.send(message)
|
channel.send(message)
|
||||||
} else {
|
} 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) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user