diff --git a/src/execution.ts b/src/execution.ts index 579a435..8c550af 100644 --- a/src/execution.ts +++ b/src/execution.ts @@ -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 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})` : `#@${getAuthor(message).tag}` ;