From 83520eb6b55584814d61afe7e3b570ab70f385ae Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 2 Apr 2024 00:10:25 +0200 Subject: [PATCH] format files --- src/buttons/loader.ts | 8 ++-- src/buttons/misc/reminderList-next.ts | 6 +-- src/buttons/misc/reminderList-prec.ts | 6 +-- src/buttons/music/queueList-next.ts | 6 +-- src/buttons/music/queueList-prec.ts | 6 +-- src/commands/loader.ts | 8 ++-- src/commands/misc/archive.ts | 14 +++---- src/commands/misc/help.ts | 12 +++--- src/commands/misc/ping.ts | 4 +- src/commands/misc/prep.ts | 10 ++--- src/commands/misc/reminder.ts | 58 +++++++++++++-------------- src/commands/music/lyrics.ts | 10 ++--- src/commands/music/play.ts | 10 ++--- src/commands/music/queue.ts | 30 +++++++------- src/commands/music/repeat.ts | 10 ++--- src/commands/music/skip.ts | 2 +- src/events/client/ready.ts | 2 +- src/events/loader.ts | 4 +- src/events/message/messageCreate.ts | 14 +++---- src/modals/loader.ts | 6 +-- src/modals/misc/reminderGUI.ts | 2 +- src/modules/client.ts | 2 +- src/utils/client.ts | 2 +- src/utils/locales.ts | 10 ++--- src/utils/misc.ts | 2 +- src/utils/music.ts | 6 +-- src/utils/reminder.ts | 24 +++++------ src/utils/time.ts | 2 +- 28 files changed, 138 insertions(+), 138 deletions(-) diff --git a/src/buttons/loader.ts b/src/buttons/loader.ts index bec5d3d..904f6a0 100644 --- a/src/buttons/loader.ts +++ b/src/buttons/loader.ts @@ -6,7 +6,7 @@ import { getLocale } from "../utils/locales"; export default async (client: Client) => { // Dossier des buttons const buttons_categories = (await readdir(__dirname)).filter( - (element) => !element.endsWith(".js") && !element.endsWith(".ts") + (element) => !element.endsWith(".js") && !element.endsWith(".ts"), ); await Promise.all( @@ -26,9 +26,9 @@ export default async (client: Client) => { // Add it to the collection so the interaction will work client.buttons.list.set(button.data.name, button); return button.data; - }) + }), ); - }) + }), ); }; @@ -43,7 +43,7 @@ export const collect = ( client: Client, interaction: ChatInputCommandInteraction | MessageComponentInteraction, id: string, - deferUpdate = false + deferUpdate = false, ) => { const loc = getLocale(client, interaction.locale); const button = client.buttons.list.get(id.split("_")[0]); diff --git a/src/buttons/misc/reminderList-next.ts b/src/buttons/misc/reminderList-next.ts index a652710..1689166 100644 --- a/src/buttons/misc/reminderList-next.ts +++ b/src/buttons/misc/reminderList-next.ts @@ -39,7 +39,7 @@ export default { user, interaction.guildId, page, - interaction.locale + interaction.locale, ); const idPrec = "reminderList-prec_" + uuidv4(); @@ -49,13 +49,13 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get("c_reminder12")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get("c_reminder13")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ); // Buttons interactions diff --git a/src/buttons/misc/reminderList-prec.ts b/src/buttons/misc/reminderList-prec.ts index 058fc3e..74991e6 100644 --- a/src/buttons/misc/reminderList-prec.ts +++ b/src/buttons/misc/reminderList-prec.ts @@ -39,7 +39,7 @@ export default { user, interaction.guildId, page, - interaction.locale + interaction.locale, ); const idPrec = "reminderList-prec_" + uuidv4(); @@ -49,13 +49,13 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get("c_reminder12")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get("c_reminder13")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ); // Buttons interactions diff --git a/src/buttons/music/queueList-next.ts b/src/buttons/music/queueList-next.ts index d3f4263..352e679 100644 --- a/src/buttons/music/queueList-next.ts +++ b/src/buttons/music/queueList-next.ts @@ -48,14 +48,14 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get("c_queue8")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get("c_queue9")) - .setStyle(ButtonStyle.Primary) - ) + .setStyle(ButtonStyle.Primary), + ), ); // Buttons interactions diff --git a/src/buttons/music/queueList-prec.ts b/src/buttons/music/queueList-prec.ts index 40306ca..7b8e9d1 100644 --- a/src/buttons/music/queueList-prec.ts +++ b/src/buttons/music/queueList-prec.ts @@ -48,14 +48,14 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get("c_queue8")) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get("c_queue9")) - .setStyle(ButtonStyle.Primary) - ) + .setStyle(ButtonStyle.Primary), + ), ); // Buttons interactions diff --git a/src/commands/loader.ts b/src/commands/loader.ts index ba5785b..b035a1e 100644 --- a/src/commands/loader.ts +++ b/src/commands/loader.ts @@ -9,7 +9,7 @@ export default async (client: Client) => { const rest = new REST({ version: "10" }).setToken(client.token ?? ""); const command_categories = (await readdir(__dirname)).filter( - (element) => !element.endsWith(".js") && !element.endsWith(".ts") + (element) => !element.endsWith(".js") && !element.endsWith(".ts"), ); const commands = ( @@ -33,9 +33,9 @@ export default async (client: Client) => { client.commands.list.set(command.data.name, command); return command; - }) + }), ); - }) + }), ) ).flat(2); @@ -66,7 +66,7 @@ export default async (client: Client) => { async (command, guild) => await rest.put(Routes.applicationGuildCommands(client.user?.id as string, guild), { body: command, - }) + }), ); // Send global commands to Discord diff --git a/src/commands/misc/archive.ts b/src/commands/misc/archive.ts index 935d93b..8f8053f 100644 --- a/src/commands/misc/archive.ts +++ b/src/commands/misc/archive.ts @@ -20,7 +20,7 @@ export default { new SlashCommandBuilder() .setName(filename.toLowerCase()) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true)) .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)) @@ -29,13 +29,13 @@ export default { .addStringOption((option) => option .setName( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "", ) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), ) ); }, @@ -45,7 +45,7 @@ export default { const desiredCat = interaction.options.get( client.locales .get(client.config.default_lang) - ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "" + ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "", )?.value as string; // If a category isn't specified @@ -126,13 +126,13 @@ export default { loc.get("c_archive5") + " `" + catArchivedName + - "`" + "`", ) .setDescription( allChannelDesired .map((cgD) => cgD?.name) .toString() - .replaceAll(",", "\n") + .replaceAll(",", "\n"), ), ], }); diff --git a/src/commands/misc/help.ts b/src/commands/misc/help.ts index 0353e59..48a455c 100644 --- a/src/commands/misc/help.ts +++ b/src/commands/misc/help.ts @@ -14,7 +14,7 @@ export default { new SlashCommandBuilder() .setName(filename.toLowerCase()) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true)) .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)) @@ -23,13 +23,13 @@ export default { .addStringOption((option) => option .setName( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "", ) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), ) ); }, @@ -39,7 +39,7 @@ export default { const desired_command = interaction.options.getString( client.locales .get(client.config.default_lang) - ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "" + ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "", ); // If a command isn't specified @@ -96,7 +96,7 @@ export default { // Loads the description // according to the user's locals command.data.description_localizations?.[interaction.locale as Locale] ?? - command.data.description + command.data.description, ), ], }); diff --git a/src/commands/misc/ping.ts b/src/commands/misc/ping.ts index 7d62d24..0d80bc8 100644 --- a/src/commands/misc/ping.ts +++ b/src/commands/misc/ping.ts @@ -11,7 +11,7 @@ export default { return new SlashCommandBuilder() .setName(filename.toLowerCase()) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true)) .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)); @@ -28,7 +28,7 @@ export default { interaction.editReply( `${loc?.get("c_ping1")}: \ ${sent.createdTimestamp - interaction.createdTimestamp}ms -${loc?.get("c_ping2")}: ${client.ws.ping}ms.` +${loc?.get("c_ping2")}: ${client.ws.ping}ms.`, ); }, }; diff --git a/src/commands/misc/prep.ts b/src/commands/misc/prep.ts index 36676d6..eeffddf 100644 --- a/src/commands/misc/prep.ts +++ b/src/commands/misc/prep.ts @@ -13,7 +13,7 @@ export default { new SlashCommandBuilder() .setName(filename.toLowerCase()) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_name`, true)) .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)) @@ -22,13 +22,13 @@ export default { .addStringOption((option) => option .setName( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_name`) ?? "", ) .setDescription( - client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "" + client.locales.get(client.config.default_lang)?.get(`c_${filename}_opt1_desc`) ?? "", ) .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), ) ); }, @@ -38,7 +38,7 @@ export default { const desired_cat = interaction.options.get( client.locales .get(client.config.default_lang) - ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "" + ?.get(`c_${getFilename(__filename)}_opt1_name`) ?? "", )?.value as string; // If a category isn't specified diff --git a/src/commands/misc/reminder.ts b/src/commands/misc/reminder.ts index 4f2d4e4..5e3f943 100644 --- a/src/commands/misc/reminder.ts +++ b/src/commands/misc/reminder.ts @@ -53,11 +53,11 @@ export default { .setName(loc_default.get(`c_${filename}_sub1_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub1_opt1_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt1_name`, true) + getLocalizations(client, `c_${filename}_sub1_opt1_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt1_desc`) - ) + getLocalizations(client, `c_${filename}_sub1_opt1_desc`), + ), ) // Specified message (not required) @@ -66,12 +66,12 @@ export default { .setName(loc_default.get(`c_${filename}_sub1_opt2_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub1_opt2_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt2_name`, true) + getLocalizations(client, `c_${filename}_sub1_opt2_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt2_desc`) - ) - ) + getLocalizations(client, `c_${filename}_sub1_opt2_desc`), + ), + ), ) // List reminders @@ -88,11 +88,11 @@ export default { .setName(loc_default.get(`c_${filename}_sub2_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub2_opt1_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub2_opt1_name`, true) + getLocalizations(client, `c_${filename}_sub2_opt1_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub2_opt1_desc`) - ) + getLocalizations(client, `c_${filename}_sub2_opt1_desc`), + ), ) // Page @@ -101,12 +101,12 @@ export default { .setName(loc_default.get(`c_${filename}_sub2_opt2_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub2_opt2_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub2_opt2_name`, true) + getLocalizations(client, `c_${filename}_sub2_opt2_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub2_opt2_desc`) - ) - ) + getLocalizations(client, `c_${filename}_sub2_opt2_desc`), + ), + ), ) // Delete a reminder @@ -123,13 +123,13 @@ export default { .setName(loc_default.get(`c_${filename}_sub3_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub3_opt1_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub3_opt1_name`, true) + getLocalizations(client, `c_${filename}_sub3_opt1_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub3_opt1_desc`) + getLocalizations(client, `c_${filename}_sub3_opt1_desc`), ) - .setRequired(true) - ) + .setRequired(true), + ), ) ); }, @@ -145,14 +145,14 @@ export default { case loc_default?.get(`c_${filename}_sub1_name`)?.toLowerCase() ?? "": { // If time is already renseigned const time = interaction.options.getString( - loc_default?.get(`c_${filename}_sub1_opt1_name`) as string + loc_default?.get(`c_${filename}_sub1_opt1_name`) as string, ); if (time != null) { // Use the cli because we already have enough data return newReminder(client, time, { locale: interaction.locale, message: interaction.options.getString( - loc_default?.get(`c_${filename}_sub1_opt2_name`) as string + loc_default?.get(`c_${filename}_sub1_opt2_name`) as string, ), createdAt: interaction.createdAt.getTime(), channelId: interaction.channelId, @@ -162,7 +162,7 @@ export default { interaction.reply({ content: msg as string, ephemeral: true, - }) + }), ); } else { // Show modal to user to get at least the time @@ -186,7 +186,7 @@ export default { modal.addComponents( new ActionRowBuilder().addComponents(timeGUI), - new ActionRowBuilder().addComponents(messageGUI) + new ActionRowBuilder().addComponents(messageGUI), ); return interaction.showModal(modal); @@ -196,7 +196,7 @@ export default { case loc_default?.get(`c_${filename}_sub2_name`)?.toLowerCase() ?? "": { // Which user to show let user = interaction.options.getUser( - loc_default?.get(`c_${filename}_sub2_opt1_name`) as string + loc_default?.get(`c_${filename}_sub2_opt1_name`) as string, ); if (user == null) { user = interaction.user; @@ -204,14 +204,14 @@ export default { const page = interaction.options.getInteger( - loc_default?.get(`c_${filename}_sub2_opt2_name`) as string + loc_default?.get(`c_${filename}_sub2_opt2_name`) as string, ) ?? 1; const list = await embedListReminders( client, user, interaction.guildId, page, - interaction.locale + interaction.locale, ); const idPrec = "reminderList-prec_" + uuidv4(); @@ -221,13 +221,13 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get(`c_${filename}12`)) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get(`c_${filename}13`)) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ); // Buttons interactions @@ -243,7 +243,7 @@ export default { // Delete a reminder case loc_default?.get(`c_${filename}_sub3_name`)?.toLowerCase() ?? "": { const id = interaction.options.getInteger( - loc_default?.get(`c_${filename}_sub3_opt1_name`) as string + loc_default?.get(`c_${filename}_sub3_opt1_name`) as string, ); if (id === null) { return interaction.reply({ @@ -271,7 +271,7 @@ export default { interaction.reply({ content: `Reminder **#${id}** supprimé !`, ephemeral: true, - }) + }), ); } default: { diff --git a/src/commands/music/lyrics.ts b/src/commands/music/lyrics.ts index 2402624..9c18add 100644 --- a/src/commands/music/lyrics.ts +++ b/src/commands/music/lyrics.ts @@ -35,8 +35,8 @@ export default { .setName(loc_default.get(`c_${filename}_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_opt1_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) - ) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), + ), ) // Romanized @@ -53,8 +53,8 @@ export default { .setName(loc_default.get(`c_${filename}_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_opt1_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) - ) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), + ), ) ); }, @@ -66,7 +66,7 @@ export default { const loc = getLocale(client, interaction.locale); let request = interaction.options.getString( - loc_default?.get(`c_${filename}_opt1_name`) as string + loc_default?.get(`c_${filename}_opt1_name`) as string, ); let data = null; diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index 6c08a95..36588c3 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -36,7 +36,7 @@ export default { .setDescription(loc_default.get(`c_${filename}_opt1_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) - .setAutocomplete(true) + .setAutocomplete(true), ) ); }, @@ -68,7 +68,7 @@ export default { } const query = interaction.options.getString( - loc_default?.get(`c_${filename}_opt1_name`) as string + loc_default?.get(`c_${filename}_opt1_name`) as string, ); const player = useMainPlayer() as Player; @@ -82,7 +82,7 @@ export default { if (track) { const embed = new EmbedBuilder() .setDescription( - `${queue.node.createProgressBar()}\n\n${loc.get("c_play8")} ${track.requestedBy}` + `${queue.node.createProgressBar()}\n\n${loc.get("c_play8")} ${track.requestedBy}`, ) .setTitle(track.title + " • " + track.author) .setURL(track.url) @@ -158,7 +158,7 @@ export default { const player = useMainPlayer() as Player; const query = interaction.options.getString( loc_default?.get(`c_${filename}_opt1_name`) as string, - true + true, ); const limit_value_discord = 100; @@ -225,7 +225,7 @@ export default { name, value: t.url, }; - }) + }), ); } } diff --git a/src/commands/music/queue.ts b/src/commands/music/queue.ts index 98c874c..f921bc9 100644 --- a/src/commands/music/queue.ts +++ b/src/commands/music/queue.ts @@ -45,12 +45,12 @@ export default { .setName(loc_default.get(`c_${filename}_sub1_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub1_opt1_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt1_name`, true) + getLocalizations(client, `c_${filename}_sub1_opt1_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub1_opt1_desc`) - ) - ) + getLocalizations(client, `c_${filename}_sub1_opt1_desc`), + ), + ), ) // Shuffle Queue @@ -59,7 +59,7 @@ export default { .setName(loc_default.get(`c_${filename}_sub2_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub2_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_sub2_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub2_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub2_desc`)), ) // Remove @@ -77,13 +77,13 @@ export default { .setName(loc_default.get(`c_${filename}_sub3_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub3_opt1_desc`) ?? "") .setNameLocalizations( - getLocalizations(client, `c_${filename}_sub3_opt1_name`, true) + getLocalizations(client, `c_${filename}_sub3_opt1_name`, true), ) .setDescriptionLocalizations( - getLocalizations(client, `c_${filename}_sub3_opt1_desc`) + getLocalizations(client, `c_${filename}_sub3_opt1_desc`), ) - .setRequired(true) - ) + .setRequired(true), + ), ) ); }, @@ -105,7 +105,7 @@ export default { case loc_default?.get(`c_${filename}_sub1_name`)?.toLowerCase() ?? "": { const page = interaction.options.getNumber( - loc_default?.get(`c_${filename}_sub1_opt1_name`) as string + loc_default?.get(`c_${filename}_sub1_opt1_name`) as string, ) ?? 1; embedListQueue(client, embed, queue, page, interaction.locale); @@ -118,14 +118,14 @@ export default { new ButtonBuilder() .setCustomId(idPrec) .setLabel(loc.get(`c_${filename}8`)) - .setStyle(ButtonStyle.Primary) + .setStyle(ButtonStyle.Primary), ) .addComponents( new ButtonBuilder() .setCustomId(idNext) .setLabel(loc.get(`c_${filename}9`)) - .setStyle(ButtonStyle.Primary) - ) + .setStyle(ButtonStyle.Primary), + ), ); // Buttons interactions @@ -146,14 +146,14 @@ export default { // Remove case loc_default?.get(`c_${filename}_sub3_name`)?.toLowerCase() ?? "": { const id = interaction.options.getNumber( - loc_default?.get(`c_${filename}_sub3_opt1_name`) as string + loc_default?.get(`c_${filename}_sub3_opt1_name`) as string, ) as number; const track = queue.removeTrack(id - 1); if (track) { embed.setDescription( - `${loc.get("c_queue4")} #${id} \`${track.title}\` ${loc.get("c_queue5")}` + `${loc.get("c_queue4")} #${id} \`${track.title}\` ${loc.get("c_queue5")}`, ); } else { embed.setDescription(loc.get("c_queue6")); diff --git a/src/commands/music/repeat.ts b/src/commands/music/repeat.ts index 44fb33c..08d376b 100644 --- a/src/commands/music/repeat.ts +++ b/src/commands/music/repeat.ts @@ -27,7 +27,7 @@ export default { .setName(loc_default.get(`c_${filename}_sub1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub1_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_sub1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub1_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub1_desc`)), ) // Repeat current track @@ -36,7 +36,7 @@ export default { .setName(loc_default.get(`c_${filename}_sub2_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub2_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_sub2_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub2_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub2_desc`)), ) // Repeat queue @@ -45,7 +45,7 @@ export default { .setName(loc_default.get(`c_${filename}_sub3_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub3_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_sub3_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub3_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub3_desc`)), ) // Enable autoplay @@ -54,7 +54,7 @@ export default { .setName(loc_default.get(`c_${filename}_sub4_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_sub4_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_sub4_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub4_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_sub4_desc`)), ) ); }, @@ -91,7 +91,7 @@ export default { case loc_default?.get(`c_${filename}_sub2_name`)?.toLowerCase() ?? "": { queue.setRepeatMode(QueueRepeatMode.TRACK); return interaction.reply( - `${loc.get("c_repeat5")} ${queue.history.currentTrack?.title} ${loc.get("c_repeat6")}.` + `${loc.get("c_repeat5")} ${queue.history.currentTrack?.title} ${loc.get("c_repeat6")}.`, ); } } diff --git a/src/commands/music/skip.ts b/src/commands/music/skip.ts index fffb5a3..d17038d 100644 --- a/src/commands/music/skip.ts +++ b/src/commands/music/skip.ts @@ -27,7 +27,7 @@ export default { .setName(loc_default.get(`c_${filename}_opt1_name`)?.toLowerCase() ?? "") .setDescription(loc_default.get(`c_${filename}_opt1_desc`) ?? "") .setNameLocalizations(getLocalizations(client, `c_${filename}_opt1_name`, true)) - .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_opt1_desc`)), ) ); }, diff --git a/src/events/client/ready.ts b/src/events/client/ready.ts index ab55980..7a2c518 100644 --- a/src/events/client/ready.ts +++ b/src/events/client/ready.ts @@ -55,7 +55,7 @@ export default async (client: Client) => { client, info, element.option_id, - (element.expiration_date - now) / 1000 + (element.expiration_date - now) / 1000, ); // Update timeout in database diff --git a/src/events/loader.ts b/src/events/loader.ts index 783c181..d0ee1c0 100644 --- a/src/events/loader.ts +++ b/src/events/loader.ts @@ -5,7 +5,7 @@ import { readdir } from "fs/promises"; /** Load all the events. */ export default async (client: Client) => { const events_categories = (await readdir(__dirname)).filter( - (element) => !element.endsWith(".js") && !element.endsWith(".ts") + (element) => !element.endsWith(".js") && !element.endsWith(".ts"), ); events_categories.forEach(async (event_category) => { @@ -50,7 +50,7 @@ export default async (client: Client) => { return client.on(event_type, (...args) => { execute(...args, client); }); - }) + }), ); }); }; diff --git a/src/events/message/messageCreate.ts b/src/events/message/messageCreate.ts index 21a94a3..c82a409 100644 --- a/src/events/message/messageCreate.ts +++ b/src/events/message/messageCreate.ts @@ -40,10 +40,10 @@ export default async (message: Message, client: Client) => { message_id: string; channel: TextBasedChannel; }[] = [], - match + match, ) => { const [, guild_id, channel_id, message_id] = new RegExp(regex).exec( - match + match, ) as RegExpExecArray; // If message posted in another guild @@ -62,7 +62,7 @@ export default async (message: Message, client: Client) => { return data; }, - [] + [], ) .map(async ({ message_id, channel }) => { const quoted_message = await channel.messages.fetch(message_id).catch(() => undefined); @@ -76,7 +76,7 @@ export default async (message: Message, client: Client) => { } return quoted_message; - }) + }), ) ) // Remove undefined elements @@ -124,7 +124,7 @@ export default async (message: Message, client: Client) => { let footer = `Posté le ${showDate( client.config.default_lang, loc, - quoted_post?.createdAt as Date + quoted_post?.createdAt as Date, )}`; if (quoted_post?.editedAt) { footer += ` et modifié le ${showDate(client.config.default_lang, loc, quoted_post.editedAt)}`; @@ -137,7 +137,7 @@ export default async (message: Message, client: Client) => { footer += `\nCité par ${userWithNickname(message.member as GuildMember) ?? "?"} le ${showDate( client.config.default_lang, loc, - message.createdAt + message.createdAt, )}`; } @@ -157,7 +157,7 @@ export default async (message: Message, client: Client) => { name: "Message", value: `${quoted_post?.channel} - [Lien Message](${quoted_post?.url})`, inline: true, - } + }, ); // Delete source message if no content when removing links diff --git a/src/modals/loader.ts b/src/modals/loader.ts index c8d622e..7f623e9 100644 --- a/src/modals/loader.ts +++ b/src/modals/loader.ts @@ -5,7 +5,7 @@ import { removeExtension } from "../utils/misc"; export default async (client: Client) => { // Dossier des modals const modals_categories = (await readdir(__dirname)).filter( - (element) => !element.endsWith(".js") && !element.endsWith(".ts") + (element) => !element.endsWith(".js") && !element.endsWith(".ts"), ); await Promise.all( @@ -25,8 +25,8 @@ export default async (client: Client) => { // Add it to the collection so the interaction will work client.modals.list.set(modal.data.name, modal); return modal.data; - }) + }), ); - }) + }), ); }; diff --git a/src/modals/misc/reminderGUI.ts b/src/modals/misc/reminderGUI.ts index a0e2ac7..1d4639b 100644 --- a/src/modals/misc/reminderGUI.ts +++ b/src/modals/misc/reminderGUI.ts @@ -18,6 +18,6 @@ export default { interaction.reply({ content: msg as string, ephemeral: true, - }) + }), ), }; diff --git a/src/modules/client.ts b/src/modules/client.ts index 8d4f519..fb9efcf 100644 --- a/src/modules/client.ts +++ b/src/modules/client.ts @@ -57,7 +57,7 @@ declare module "discord.js" { /** How the button interact */ interaction: ( interaction: MessageComponentInteraction, - client: Client + client: Client, ) => Promise; } >; diff --git a/src/utils/client.ts b/src/utils/client.ts index 8aa3330..4e4902a 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -88,6 +88,6 @@ const initDatabase = (db: Database) => { guild_id TEXT, \ locale TEXT, \ timeout_id TEXT \ - );" + );", ); }; diff --git a/src/utils/locales.ts b/src/utils/locales.ts index 90120da..4d446f4 100644 --- a/src/utils/locales.ts +++ b/src/utils/locales.ts @@ -33,10 +33,10 @@ export const loadLocales = async (default_lang: string) => { .filter((str) => str !== "default") .map((str) => { return [str, content[str]]; - }) - ) + }), + ), ); - }) + }), ); // Check locales sanity @@ -130,7 +130,7 @@ const checkLocales = async (locales: Map>, default_l // and the security is poor, but it's better than nothing. throw new Error( `The default locale (${default_lang} = ${default_lang_size}) isn't complete ` + - `(${max_size_name} = ${max_size}).` + `(${max_size_name} = ${max_size}).`, ); } @@ -167,7 +167,7 @@ const checkLocales = async (locales: Map>, default_l const padding = " ".repeat(lang.length === 5 ? 1 : 4); console.log( - `${padding}${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%` + `${padding}${lang} | ${color()}${blocks}\x1b[0m${blank} | ${percentage.toPrecision(3)}%`, ); }); }; diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 8a24cbc..5240650 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -94,7 +94,7 @@ export const cleanCodeBlock = (text: string) => { /(http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)/g, function (url: string) { return `\`${url}\``; - } + }, ); // Fix issues diff --git a/src/utils/music.ts b/src/utils/music.ts index db40104..bcf5002 100644 --- a/src/utils/music.ts +++ b/src/utils/music.ts @@ -8,7 +8,7 @@ export const embedListQueue = ( embed: EmbedBuilder, queue: GuildQueue, page: number, - local: string + local: string, ) => { const loc = getLocale(client, local); const tracks = queue.tracks.toArray(); @@ -29,8 +29,8 @@ export const embedListQueue = ( const name = now_playing ? loc.get("c_queue10") : (idx == 1 && page == 1) || (idx == 0 && page > 1) - ? loc.get("c_queue11") - : "\u200b"; + ? loc.get("c_queue11") + : "\u200b"; const idx_track = now_playing ? "" : `${idx + limit_fields * (page - 1)}. `; embed.addFields({ name, diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index d529f47..08004c1 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -92,7 +92,7 @@ export const newReminder = async (client: Client, time: string, info: infoRemind // Send confirmation to user const loc = getLocale(client, info.locale); ok(`${loc.get("c_reminder1")} ${data.time}.`); - } + }, ); }); @@ -117,7 +117,7 @@ export const deleteReminder = (client: Client, createdAt: string, userId: string // Send confirmation to user ok(true); - } + }, ); }); }; @@ -200,7 +200,7 @@ export const setTimeoutReminder = ( client: Client, info: infoReminder, option: OptionReminder, - timeout: number + timeout: number, ) => { return Number( setTimeout(() => { @@ -211,7 +211,7 @@ export const setTimeoutReminder = ( sendReminder(client, info, option); }); - }, timeout * 1000) + }, timeout * 1000), ); }; @@ -226,7 +226,7 @@ export const checkOwnershipReminder = async ( client: Client, id: number, userId: string, - guildId: string + guildId: string, ) => { type returnData = { [key: string]: number }; @@ -247,7 +247,7 @@ export const checkOwnershipReminder = async ( // Send all the current reminders ok(row[0]); - } + }, ); })) as returnData; return Object.keys(data).map((key) => data[key])[0] === 0 ? true : false; @@ -272,7 +272,7 @@ export const getReminderInfo = async (client: Client, id: number) => { // Send all the current reminders ok(row[0]); - } + }, ); })) as dbReminder; }; @@ -316,7 +316,7 @@ export const updateReminder = (client: Client, data: dbReminder) => { } ok(true); - } + }, ); }); }; @@ -342,7 +342,7 @@ const listReminders = async (client: Client, userId: string, guildId: string | n // Send all the current reminders ok(row); - } + }, ); })) as dbReminder[]; }; @@ -361,7 +361,7 @@ export const embedListReminders = async ( user: User, guildId: string | null, page: number, - local: string + local: string, ) => { const loc = getLocale(client, local); const reminders = await listReminders(client, user.id, guildId); @@ -376,7 +376,7 @@ export const embedListReminders = async ( const embed = new EmbedBuilder() .setColor(Colors.DarkGrey) .setDescription( - `${loc.get("c_reminder5")} ${user} • ${loc.get("c_reminder6")} ${page}/${pageMax}` + `${loc.get("c_reminder5")} ${user} • ${loc.get("c_reminder6")} ${page}/${pageMax}`, ) .setThumbnail(user.displayAvatarURL()); @@ -396,7 +396,7 @@ export const embedListReminders = async ( name: `#${remind.id} • ${loc.get("c_reminder9")} ${showDate( local, loc, - new Date(Number(remind.creation_date)) + new Date(Number(remind.creation_date)), )}\n${expiration}`, value: text, inline: false, diff --git a/src/utils/time.ts b/src/utils/time.ts index 6c00351..ea6d687 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -31,7 +31,7 @@ export const strToSeconds = (time: string) => { TimeSecond[TimeSecond.Hour] }>[0-9]+(?=[h]))|(?<${TimeSecond[TimeSecond.Minute]}>[0-9]+(?=[m]))|(?<${ TimeSecond[TimeSecond.Second] - }>[0-9]+(?=[s]?))` + }>[0-9]+(?=[s]?))`, ); const data = Object.assign({}, regex.exec(time)?.groups);