From 62ecb715afeab5676f288018e66251b3952b9637 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sat, 28 Jan 2023 21:04:52 +1100 Subject: [PATCH] Add subcommands to log. --- src/events/interactionCreate.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index eff4ac5..505c497 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -4,8 +4,14 @@ export default { async run(client:TClient, interaction:Discord.ChatInputCommandInteraction){ if (!interaction.inGuild() || !interaction.inCachedGuild() || !interaction.command) return; if (interaction.isCommand()){ + let Sub:string + try{ + Sub = ` ${interaction.options.getSubcommand()}` + }catch(e){ + Sub = '' + } const commandFile = client.commands.get(interaction.commandName); - console.log(`[${client.moment().format('DD/MM/YY HH:mm:ss')}] ${interaction.user.tag} used /${interaction.commandName} in #${interaction.channel.name}`); + console.log(`[${client.moment().format('DD/MM/YY HH:mm:ss')}] ${interaction.user.tag} used /${interaction.commandName}${Sub} in #${interaction.channel.name}`); if (!client.config.botSwitches.commands && !client.config.eval.whitelist.includes(interaction.user.id)) return interaction.reply({content: 'Bot is currently being run in development mode.', ephemeral: true}); if (commandFile){ try{