From 9a022ec0027f1911b6f2d4f719d3e3866d33d781 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 24 Jan 2024 10:40:43 +0100 Subject: [PATCH] Updated command logger --- src/events/server/interactions/logBtnsCmds.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/events/server/interactions/logBtnsCmds.ts b/src/events/server/interactions/logBtnsCmds.ts index 1075cc1..c00df06 100644 --- a/src/events/server/interactions/logBtnsCmds.ts +++ b/src/events/server/interactions/logBtnsCmds.ts @@ -9,19 +9,29 @@ export = { execute(interaction: ChatInputCommandInteraction | ButtonInteraction) { if (interaction.isCommand()) { + let subcommand: string | null + try { + subcommand = interaction.options.getSubcommand() + } catch (e) { + subcommand = null + } + + if (subcommand) { console.log( color( - interaction.user.username + " ran " + + interaction.user.username + "#" + + interaction.user.discriminator + " ran " + interaction.commandName + " " + - interaction.options.getSubcommand(), + subcommand, "pink" ) ) - } catch { + } else { console.log( color( - interaction.user.username + " ran " + + interaction.user.username + "#" + + interaction.user.discriminator + " ran " + interaction.commandName, "pink" )