refactor(commands/custom): now using the new log system

This commit is contained in:
Raphael 2025-10-26 17:51:13 +01:00 committed by Raphaël
parent 9f545203f3
commit 491feedfaf

View file

@ -8,6 +8,7 @@ import {
} from 'discord.js'; } from 'discord.js';
import emoji from '../../../assets/emoji.json' assert { type: 'json' }; import emoji from '../../../assets/emoji.json' assert { type: 'json' };
import { User as UserPrisma } from '@prisma/client'; import { User as UserPrisma } from '@prisma/client';
import { log } from '@lib/log.js';
export default { export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
@ -119,9 +120,7 @@ export default {
}); });
} }
catch (err) { catch (err) {
console.error( log.error(err, 'Cannot get the database connection!');
`\t⚠ | Cannot get the database connection!\n\t\t(${err as Error}).`,
);
await interaction.reply({ await interaction.reply({
content: `${emoji.answer.error} | Cannot connect to the database`, content: `${emoji.answer.error} | Cannot connect to the database`,
flags: MessageFlags.Ephemeral, flags: MessageFlags.Ephemeral,
@ -215,9 +214,7 @@ export default {
content: `${emoji.answer.no} | Error during changing the bot profile picture`, content: `${emoji.answer.no} | Error during changing the bot profile picture`,
flags: MessageFlags.Ephemeral, flags: MessageFlags.Ephemeral,
}); });
console.error( log.error(err, 'Cannot change the bot profile picture!');
`\t⚠ | Cannot change the bot profile picture!\n\t\t(${err as Error}).`,
);
} }
await interaction.reply({ await interaction.reply({
content: `${emoji.answer.yes} | The picture profile of the bot is now updated.`, content: `${emoji.answer.yes} | The picture profile of the bot is now updated.`,