From 1b402c791ce8f4963f10cb8d8ac6919893ca6b22 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Fri, 26 Apr 2024 08:13:29 +0200 Subject: [PATCH] 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 --- src/execution.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}` ;