execution: log channel ID to terminal if it's unknown

channelId is set for commands executed outside of common guilds
no changes for usage logging in database is required
This commit is contained in:
Wroclaw 2024-04-26 08:13:29 +02:00
parent c4edf55f65
commit 1b402c791c

View file

@ -191,7 +191,8 @@ function logUsedTokens(
// it doesn't make sense to store usage in database if we don't know where it came from // it doesn't make sense to store usage in database if we don't know where it came from
return; return;
} }
const channelName: string = !message.channel ? "[No channel]" const channelName: string = !message.channelId ? "[No channel]"
: !message.channel ? `[Unknown channel: ${message.channelId}]`
: !message.channel.isDMBased() ? `#${message.channel.name} (${message.guild?.name})` : !message.channel.isDMBased() ? `#${message.channel.name} (${message.guild?.name})`
: `#@${getAuthor(message).tag}` : `#@${getAuthor(message).tag}`
; ;