refactor(cmd/custom): adding the tsconfig + eslint correction

This commit is contained in:
Raphael 2025-10-14 00:17:45 +02:00 committed by Raphaël
parent 8d41ef8f7a
commit a0a9cac16d

View file

@ -1,9 +1,9 @@
import { prisma } from '../../lib/prisma.ts'; import { prisma } from '@lib/prisma';
import { SlashCommandBuilder } from '@discordjs/builders';
import { import {
ActivityType, ActivityType,
PresenceUpdateStatus, PresenceUpdateStatus,
MessageFlags, MessageFlags,
SlashCommandBuilder,
CommandInteraction, CommandInteraction,
} from 'discord.js'; } from 'discord.js';
import emoji from '../../../assets/emoji.json' assert { type: 'json' }; import emoji from '../../../assets/emoji.json' assert { type: 'json' };
@ -120,7 +120,7 @@ export default {
} }
catch (err) { catch (err) {
console.error( console.error(
`\t⚠ | Cannot get the database connection!\n\t\t(${err}).`, `\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`,
@ -208,7 +208,7 @@ export default {
} }
const newPicture: string = interaction.options.getString('link'); const newPicture: string = interaction.options.getString('link');
try { try {
interaction.client.user.setAvatar(newPicture); await interaction.client.user.setAvatar(newPicture);
} }
catch (err) { catch (err) {
await interaction.reply({ await interaction.reply({
@ -216,7 +216,7 @@ export default {
flags: MessageFlags.Ephemeral, flags: MessageFlags.Ephemeral,
}); });
console.error( console.error(
`\t⚠ | Cannot change the bot profile picture!\n\t\t(${err}).`, `\t⚠ | Cannot change the bot profile picture!\n\t\t(${err as Error}).`,
); );
} }
await interaction.reply({ await interaction.reply({
@ -312,7 +312,7 @@ export default {
} }
catch (err) { catch (err) {
await interaction.reply({ await interaction.reply({
content: `${emoji.answer.no} | Cannot change the status\n\n\t${err}`, content: `${emoji.answer.no} | Cannot change the status\n\n\t${err as Error}`,
flags: MessageFlags.Ephemeral, flags: MessageFlags.Ephemeral,
}); });
return; return;