From 6c3a7587e831b66c058fa8e0891f32f8f77b5128 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 26 Oct 2025 17:39:48 +0100 Subject: [PATCH] refactor(events/interaction): now using the new log system --- src/events/interaction/interaction.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/events/interaction/interaction.ts b/src/events/interaction/interaction.ts index 8ec0b60..3909272 100644 --- a/src/events/interaction/interaction.ts +++ b/src/events/interaction/interaction.ts @@ -1,18 +1,24 @@ -import { CommandInteraction, Events, Interaction, MessageFlags } from 'discord.js'; +import { + CommandInteraction, + Events, + Interaction, + MessageFlags, +} from 'discord.js'; import emoji from '../../../assets/emoji.json' assert { type: 'json' }; +import { log } from '@lib/log'; export default { name: Events.InteractionCreate, async execute(interaction: Interaction) { if (!interaction.isChatInputCommand()) return; - const command: CommandInteraction = interaction.client.commands.get(interaction.commandName); + const command: CommandInteraction = interaction.client.commands.get( + interaction.commandName, + ); try { await command.execute(interaction); } catch (err) { - console.error( - `⚠️ | Error when occured this command ${interaction.commandName}\n\t${err as Error}`, - ); + log.error(err, `Error when occured this command ${interaction.commandName}`); if (interaction.replied || interaction.deferred) { await interaction.followUp({ content: `${emoji.answer.error} | ${interaction.commandName} seems have a problem, thanks report that to the support (After Print)`,