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" )