From d3d9a305d0b877974da1fc5389e0175a06b2e48d Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 6 Feb 2024 15:50:12 +0100 Subject: [PATCH] fix generic command name getter --- events/interactionCreate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/events/interactionCreate.js b/events/interactionCreate.js index 4afa97a..991a368 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -21,9 +21,9 @@ const executeCommand = async (interaction, command) => { } }; -const genericExecute = async (interaction, command, name, description) => { +const genericExecute = async (interaction, command, name, description, cmdName) => { try { - console.info(`[INFO] Command ${interaction.commandName} ${description ?? `used "${name}"`}.`); + console.info(`[INFO] Command ${(cmdName ?? interaction.commandName) ?? 'anonymous'} ${description ?? `used "${name}"`}.`); await command[name](interaction); } catch (error) { console.error(error); @@ -49,7 +49,7 @@ export async function execute(interaction) { const name = interaction.customId.split('-')[0]; command = interaction.client.commands.get(name); - await genericExecute(interaction, command, 'modalSubmit', 'submitted a modal'); + await genericExecute(interaction, command, 'modalSubmit', 'submitted a modal', name); return; }