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

This commit is contained in:
Raphael 2025-10-26 17:50:42 +01:00 committed by Raphaël
parent afb9b13647
commit bdfa9e1c9b

View file

@ -8,6 +8,7 @@ import {
Guild,
} from 'discord.js';
import emoji from '../../../assets/emoji.json' assert { type: 'json' };
import { log } from '@lib/log';
function getGuildRoles(guild: Guild): string {
const roles = guild.roles.cache
@ -75,9 +76,7 @@ export default {
});
}
catch (err) {
console.error(
`\t⚠ | Cannot get the database connection!\n\t\t(${err as Error}).`,
);
log.error(err, 'Cannot get the database connection!');
await interaction.reply({
content: `${emoji.answer.error} | Cannot connect to the database`,
flags: MessageFlags.Ephemeral,
@ -99,9 +98,7 @@ export default {
});
}
catch (err) {
console.error(
`\t⚠ | Cannot get the database connection!\n\t\t(${err as Error}).`,
);
log.error(err, 'Cannot get the database connection!');
await interaction.reply({
content: `${emoji.answer.error} | Cannot connect to the database`,
flags: MessageFlags.Ephemeral,
@ -113,7 +110,7 @@ export default {
targetServer = await interaction.guild.members.fetch(targetGlobal.id);
}
catch (err) {
console.error(`\t⚠ | Cannot get the targetServer!\n\t\t(${err as Error}).`);
log.error(err, 'Cannot get the targetServer!');
await interaction.reply({
content: `${emoji.answer.error} | Cannot get the guild profile of the user`,
flags: MessageFlags.Ephemeral,