From 9f545203f3bcd21126f827200cc6e460aa38afed Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 26 Oct 2025 17:50:59 +0100 Subject: [PATCH] refactor(commands/moderation): now using the new log system --- src/commands/moderation/nuke.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/commands/moderation/nuke.ts b/src/commands/moderation/nuke.ts index 78f2829..a827c7f 100644 --- a/src/commands/moderation/nuke.ts +++ b/src/commands/moderation/nuke.ts @@ -1,7 +1,13 @@ import { SlashCommandBuilder } from '@discordjs/builders'; -import { MessageFlags, ChannelType, TextChannel, ChatInputCommandInteraction } from 'discord.js'; +import { + MessageFlags, + ChannelType, + TextChannel, + ChatInputCommandInteraction, +} from 'discord.js'; import emoji from '../../../assets/emoji.json' with { type: 'json' }; import { isWhitelisted } from '../../lib/perm.js'; +import { log } from '@lib/log'; export default { data: new SlashCommandBuilder() @@ -28,7 +34,8 @@ export default { }); return; } - const oldChannel = (interaction.options.getChannel('channel') ?? interaction.channel) as TextChannel | null; + const oldChannel = (interaction.options.getChannel('channel') ?? + interaction.channel) as TextChannel | null; if (!oldChannel) { await interaction.reply({ content: `${emoji.answer.error} | Invalid or missing text channel.`, @@ -56,7 +63,7 @@ export default { await oldChannel.delete(); } catch (err) { - console.error(`⚠️ | Error when nuking the channel\n\t${err as Error}`); + log.error(err, 'Error when nuking the channel'); await interaction.reply({ content: `${emoji.answer.no} | An error occurred while nuking the channel.`, flags: MessageFlags.Ephemeral,