From 85d3a06398db2ecf4216e94a0ff28c03798baaae Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:02:22 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in 87501c8 according to the output from Prettier. Details: None --- .../groups/bonus/subcommands/daily/index.ts | 8 ++++---- .../groups/bonus/subcommands/monthly/index.ts | 10 +++++----- .../groups/bonus/subcommands/weekly/index.ts | 8 ++++---- src/commands/credits/index.ts | 2 +- .../credits/subcommands/balance/index.ts | 12 +++++------ .../credits/subcommands/gift/index.ts | 14 ++++++------- src/commands/credits/subcommands/top/index.ts | 4 ++-- .../credits/subcommands/work/index.ts | 10 +++++----- src/commands/dns/subcommands/lookup/index.ts | 10 +++++----- src/commands/fun/subcommands/meme/index.ts | 12 +++++------ .../groups/credits/subcommands/give/index.ts | 10 +++++----- .../credits/subcommands/giveaway/index.ts | 12 +++++------ .../groups/credits/subcommands/set/index.ts | 8 ++++---- .../groups/credits/subcommands/take/index.ts | 8 ++++---- .../credits/subcommands/transfer/index.ts | 12 +++++------ .../moderation/subcommands/prune/index.ts | 10 +++++----- src/commands/quotes/subcommands/post/index.ts | 12 +++++------ src/commands/reputation/index.ts | 2 +- .../reputation/subcommands/check/index.ts | 4 ++-- .../reputation/subcommands/repute/index.ts | 10 +++++----- .../settings/subcommands/credits/index.ts | 6 +++--- .../settings/subcommands/ctrlpanel/index.ts | 8 ++++---- .../settings/subcommands/quotes/index.ts | 4 ++-- src/commands/shop/subcommands/ctrlpanel.ts | 6 +++--- src/commands/utils/subcommands/about/index.ts | 4 ++-- .../utils/subcommands/avatar/index.ts | 4 ++-- .../interactionTypes/button/index.ts | 2 +- .../handlers/handleCooldown.ts | 6 +++--- .../handlers/handleUnavailableCommand.ts | 4 ++-- .../handleCommandInteraction/index.ts | 6 +++--- .../messageCreate/components/earnCredits.ts | 10 +++++----- src/events/ready/importOldData.ts | 8 ++++---- src/handlers/CooldownManager.ts | 18 ++++++++--------- src/handlers/CreditsManager.ts | 20 +++++++++---------- src/handlers/executeSubcommand.ts | 4 ++-- src/handlers/interactionErrorHandler.ts | 6 +++--- src/handlers/registerCommands.ts | 2 +- src/handlers/registerEvents.ts | 2 +- src/handlers/updatePresence.ts | 2 +- src/helpers/upsertApiCredentials.ts | 2 +- src/services/CtrlPanelAPI.ts | 6 +++--- src/utils/deferReply.ts | 4 ++-- src/utils/encryption.ts | 2 +- src/utils/logger.ts | 6 +++--- src/utils/sendResponse.ts | 8 ++++---- 45 files changed, 164 insertions(+), 164 deletions(-) diff --git a/src/commands/credits/groups/bonus/subcommands/daily/index.ts b/src/commands/credits/groups/bonus/subcommands/daily/index.ts index bfd78f64..fdb065fc 100644 --- a/src/commands/credits/groups/bonus/subcommands/daily/index.ts +++ b/src/commands/credits/groups/bonus/subcommands/daily/index.ts @@ -25,13 +25,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { if (!guild) { throw new Error( - "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!" + "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!", ); } if (!user) { throw new Error( - "Oops! We couldn't find your user information. Please try again or contact support for assistance." + "Oops! We couldn't find your user information. Please try again or contact support for assistance.", ); } @@ -51,7 +51,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { }) .setThumbnail(user.displayAvatarURL()) .setDescription( - `You've just claimed your daily treasure of **${dailyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits` + `You've just claimed your daily treasure of **${dailyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`, ) .setFooter({ text: `Claimed by ${user.username}`, @@ -65,6 +65,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await generateCooldownName(interaction), guild, user, - startOfDay(addDays(new Date(), 1)) + startOfDay(addDays(new Date(), 1)), ); }; diff --git a/src/commands/credits/groups/bonus/subcommands/monthly/index.ts b/src/commands/credits/groups/bonus/subcommands/monthly/index.ts index 25af6521..11e500b6 100644 --- a/src/commands/credits/groups/bonus/subcommands/monthly/index.ts +++ b/src/commands/credits/groups/bonus/subcommands/monthly/index.ts @@ -27,13 +27,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { if (!guild) { throw new Error( - "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!" + "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!", ); } if (!user) { throw new Error( - "Oops! We couldn't find your user information. Please try again or contact support for assistance." + "Oops! We couldn't find your user information. Please try again or contact support for assistance.", ); } @@ -47,7 +47,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { const userEconomy = await creditsManager.give( guild, user, - monthlyBonusAmount + monthlyBonusAmount, ); const embed = new EmbedBuilder() @@ -57,7 +57,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { }) .setThumbnail(user.displayAvatarURL()) .setDescription( - `You've just claimed your monthly treasure of **${monthlyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits` + `You've just claimed your monthly treasure of **${monthlyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`, ) .setFooter({ text: `Claimed by ${user.username}`, @@ -71,6 +71,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await generateCooldownName(interaction), guild, user, - startOfDay(addMonths(new Date(), 1)) + startOfDay(addMonths(new Date(), 1)), ); }; diff --git a/src/commands/credits/groups/bonus/subcommands/weekly/index.ts b/src/commands/credits/groups/bonus/subcommands/weekly/index.ts index 5cca376c..79ed2a99 100644 --- a/src/commands/credits/groups/bonus/subcommands/weekly/index.ts +++ b/src/commands/credits/groups/bonus/subcommands/weekly/index.ts @@ -27,13 +27,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { if (!guild) { throw new Error( - "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!" + "Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!", ); } if (!user) { throw new Error( - "Oops! We couldn't find your user information. Please try again or contact support for assistance." + "Oops! We couldn't find your user information. Please try again or contact support for assistance.", ); } @@ -53,7 +53,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { }) .setThumbnail(user.displayAvatarURL()) .setDescription( - `You've just claimed your weekly treasure of **${weeklyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits` + `You've just claimed your weekly treasure of **${weeklyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`, ) .setFooter({ text: `Claimed by ${user.username}`, @@ -67,6 +67,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await generateCooldownName(interaction), guild, user, - startOfDay(addWeeks(new Date(), 1)) + startOfDay(addWeeks(new Date(), 1)), ); }; diff --git a/src/commands/credits/index.ts b/src/commands/credits/index.ts index f79d6be1..279c5f6e 100644 --- a/src/commands/credits/index.ts +++ b/src/commands/credits/index.ts @@ -40,6 +40,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await executeSubcommand( interaction, subcommandHandlers, - subcommandGroupHandlers + subcommandGroupHandlers, ); }; diff --git a/src/commands/credits/subcommands/balance/index.ts b/src/commands/credits/subcommands/balance/index.ts index 2f733843..67573778 100644 --- a/src/commands/credits/subcommands/balance/index.ts +++ b/src/commands/credits/subcommands/balance/index.ts @@ -19,8 +19,8 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("account") .setDescription( - "Enter the username of another user to check their balance" - ) + "Enter the username of another user to check their balance", + ), ); }; @@ -44,7 +44,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { checkAccount, isUserCheckAccount, pronoun, - possessivePronoun + possessivePronoun, ); await sendAccountBalanceEmbed( @@ -52,7 +52,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { description, checkAccount, pronoun, - possessivePronoun + possessivePronoun, ); }; @@ -61,7 +61,7 @@ const getAccountBalanceDescription = ( checkAccount: User, isUserCheckAccount: boolean, pronoun: string, - possessivePronoun: string + possessivePronoun: string, ) => { let description = `${ isUserCheckAccount ? "You" : checkAccount @@ -87,7 +87,7 @@ const sendAccountBalanceEmbed = async ( description: string, checkAccount: User, pronoun: string, - possessivePronoun: string + possessivePronoun: string, ) => { await sendResponse(interaction, { embeds: [ diff --git a/src/commands/credits/subcommands/gift/index.ts b/src/commands/credits/subcommands/gift/index.ts index 348c98d0..e9074237 100644 --- a/src/commands/credits/subcommands/gift/index.ts +++ b/src/commands/credits/subcommands/gift/index.ts @@ -21,7 +21,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("account") .setDescription("👤 The account you want to gift to") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option @@ -29,12 +29,12 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription("💰 The amount you want to gift") .setRequired(true) .setMinValue(1) - .setMaxValue(2147483647) + .setMaxValue(2147483647), ) .addStringOption((option) => option .setName("message") - .setDescription("💬 Your personalized message to the account") + .setDescription("💬 Your personalized message to the account"), ); }; @@ -63,14 +63,14 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { guild, recipient, amount, - message + message, ); const senderEmbed = await createSenderEmbed( guild, user, recipient, amount, - message + message, ); await recipient.send({ embeds: [recipientEmbed] }); @@ -83,7 +83,7 @@ const createRecipientEmbed = async ( guild: Guild, recipient: User, amount: number, - message: string | null + message: string | null, ) => { const recipientEmbed = new EmbedBuilder() .setTimestamp() @@ -113,7 +113,7 @@ const createSenderEmbed = async ( sender: User, recipient: User, amount: number, - message: string | null + message: string | null, ) => { const senderEmbed = new EmbedBuilder() .setTimestamp() diff --git a/src/commands/credits/subcommands/top/index.ts b/src/commands/credits/subcommands/top/index.ts index 3d6c7015..d1b31003 100644 --- a/src/commands/credits/subcommands/top/index.ts +++ b/src/commands/credits/subcommands/top/index.ts @@ -55,11 +55,11 @@ export const execute = async (interaction: CommandInteraction) => { const medalEmoji = position <= 3 ? medalEmojis[position - 1] : genericMedalEmoji; return `\`${medalEmoji} ${fieldContent}\``; - }) + }), ); const description = `Here are the top users in this server:\n\n${topUsersDescription.join( - "\n" + "\n", )}`; embed.setDescription(description); diff --git a/src/commands/credits/subcommands/work/index.ts b/src/commands/credits/subcommands/work/index.ts index 487b6fa8..819e9f41 100644 --- a/src/commands/credits/subcommands/work/index.ts +++ b/src/commands/credits/subcommands/work/index.ts @@ -31,13 +31,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { if (!guild) { throw new Error( - "Oops! It seems like you're not part of a guild. Join a guild to use this command!" + "Oops! It seems like you're not part of a guild. Join a guild to use this command!", ); } if (!user) { throw new Error( - "Oops! It looks like we couldn't find your user information. Please try again or contact support for assistance." + "Oops! It looks like we couldn't find your user information. Please try again or contact support for assistance.", ); } @@ -84,7 +84,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { // Work Description descriptions.push( - `Mission complete! You've earned **${baseCreditsEarned} credits**! 🎉` + `Mission complete! You've earned **${baseCreditsEarned} credits**! 🎉`, ); // Bonus Description @@ -99,7 +99,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { // Total Credits Description descriptions.push( - `Total earnings: **${creditsEarned} credits**. Keep up the hustle!` + `Total earnings: **${creditsEarned} credits**. Keep up the hustle!`, ); if (creditsEarned > 0) { @@ -133,6 +133,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await generateCooldownName(interaction), guild, user, - addHours(new Date(), 1) + addHours(new Date(), 1), ); }; diff --git a/src/commands/dns/subcommands/lookup/index.ts b/src/commands/dns/subcommands/lookup/index.ts index db671979..f1f17b51 100644 --- a/src/commands/dns/subcommands/lookup/index.ts +++ b/src/commands/dns/subcommands/lookup/index.ts @@ -17,7 +17,7 @@ const cooldownManager = new CooldownManager(); const dnsLookup = promisify(dns.lookup); export const builder = ( - command: SlashCommandSubcommandBuilder + command: SlashCommandSubcommandBuilder, ): SlashCommandSubcommandBuilder => { return command .setName("lookup") @@ -26,12 +26,12 @@ export const builder = ( option .setName("query") .setDescription("The query you want to look up.") - .setRequired(true) + .setRequired(true), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { await deferReply(interaction, false); @@ -75,12 +75,12 @@ export const execute = async ( await generateCooldownName(interaction), guild || null, user, - addSeconds(new Date(), 5) + addSeconds(new Date(), 5), ); } catch (error: unknown) { if ((error as NodeJS.ErrnoException).code === "ENOTFOUND") { throw new Error( - `Sorry, we couldn't find the address for the requested query: ${query}.` + `Sorry, we couldn't find the address for the requested query: ${query}.`, ); } else { throw error; diff --git a/src/commands/fun/subcommands/meme/index.ts b/src/commands/fun/subcommands/meme/index.ts index 1478ef06..d08cabb4 100644 --- a/src/commands/fun/subcommands/meme/index.ts +++ b/src/commands/fun/subcommands/meme/index.ts @@ -35,7 +35,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { await deferReply(interaction, false); @@ -59,7 +59,7 @@ export const execute = async ( }); } catch (error) { throw new Error( - "Sorry, we couldn't fetch a meme at the moment. Please try again later." + "Sorry, we couldn't fetch a meme at the moment. Please try again later.", ); } @@ -67,13 +67,13 @@ export const execute = async ( await generateCooldownName(interaction), guild || null, user, - addSeconds(new Date(), 5) + addSeconds(new Date(), 5), ); }; async function fetchRandomMeme(): Promise { const { data } = await axios.get( - "https://www.reddit.com/r/memes/random/.json" + "https://www.reddit.com/r/memes/random/.json", ); const { children } = data[0].data; const content: MemeContent = children[0].data; @@ -82,7 +82,7 @@ async function fetchRandomMeme(): Promise { async function fetchAuthorData(author: string): Promise { const { data } = await axios.get( - `https://www.reddit.com/user/${author}/about.json` + `https://www.reddit.com/user/${author}/about.json`, ); const authorData: AuthorData = data.data; return authorData; @@ -94,7 +94,7 @@ function createButtons(permalink: string) { .setLabel("View post") .setStyle(ButtonStyle.Link) .setEmoji("🔗") - .setURL(`https://reddit.com${permalink}`) + .setURL(`https://reddit.com${permalink}`), ); } diff --git a/src/commands/manage/groups/credits/subcommands/give/index.ts b/src/commands/manage/groups/credits/subcommands/give/index.ts index 472e7926..5434d878 100644 --- a/src/commands/manage/groups/credits/subcommands/give/index.ts +++ b/src/commands/manage/groups/credits/subcommands/give/index.ts @@ -12,7 +12,7 @@ import sendResponse from "../../../../../../utils/sendResponse"; const creditsManager = new CreditsManager(); export const builder = ( - command: SlashCommandSubcommandBuilder + command: SlashCommandSubcommandBuilder, ): SlashCommandSubcommandBuilder => { return command .setName("give") @@ -21,7 +21,7 @@ export const builder = ( option .setName("user") .setDescription("The user to give credits to.") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option @@ -29,12 +29,12 @@ export const builder = ( .setDescription("The amount of credits to give.") .setRequired(true) .setMinValue(1) - .setMaxValue(2147483647) + .setMaxValue(2147483647), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { const { guild, options, user } = interaction; @@ -57,7 +57,7 @@ export const execute = async ( .setColor(process.env.EMBED_COLOR_SUCCESS) .setAuthor({ name: "💳 Credits Manager" }) .setDescription( - ` Successfully gave ${creditsAmount} credits to the user.` + ` Successfully gave ${creditsAmount} credits to the user.`, ) .setFooter({ text: `Action by ${user.username}`, diff --git a/src/commands/manage/groups/credits/subcommands/giveaway/index.ts b/src/commands/manage/groups/credits/subcommands/giveaway/index.ts index 70629e03..d3f1af37 100644 --- a/src/commands/manage/groups/credits/subcommands/giveaway/index.ts +++ b/src/commands/manage/groups/credits/subcommands/giveaway/index.ts @@ -25,20 +25,20 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("uses") .setDescription("How many users should be able to use this.") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option .setName("credit") .setDescription(`How much credits provided per use.`) - .setRequired(true) + .setRequired(true), ) .addChannelOption((option) => option .setName("channel") .setDescription("The channel to send the message to.") .setRequired(true) - .addChannelTypes(ChannelType.GuildText) + .addChannelTypes(ChannelType.GuildText), ); }; @@ -69,7 +69,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { const { redeemUrl } = await ctrlPanelAPI.generateVoucher( code, creditAmount, - uses + uses, ); await sendResponse(interaction, { @@ -81,7 +81,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { .setLabel("Redeem it here") .setStyle(ButtonStyle.Link) .setEmoji("🏦") - .setURL(`${redeemUrl}`) + .setURL(`${redeemUrl}`), ); const discordChannel = await guild.channels.fetch(channel.id); @@ -99,7 +99,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { }, ]) .setDescription( - `${interaction.user} dropped a voucher for a maximum **${uses}** members!` + `${interaction.user} dropped a voucher for a maximum **${uses}** members!`, ), ], components: [buttons], diff --git a/src/commands/manage/groups/credits/subcommands/set/index.ts b/src/commands/manage/groups/credits/subcommands/set/index.ts index 9cf342ab..4cd412dd 100644 --- a/src/commands/manage/groups/credits/subcommands/set/index.ts +++ b/src/commands/manage/groups/credits/subcommands/set/index.ts @@ -19,7 +19,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("user") .setDescription("The user to set credits to.") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option @@ -27,12 +27,12 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription(`The amount of credits to set.`) .setRequired(true) .setMinValue(1) - .setMaxValue(2147483647) + .setMaxValue(2147483647), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { const { guild, options, user } = interaction; @@ -55,7 +55,7 @@ export const execute = async ( .setColor(process.env.EMBED_COLOR_SUCCESS) .setAuthor({ name: "💳 Credits Manager" }) .setDescription( - ` Successfully set ${creditsAmount} credits to the user.` + ` Successfully set ${creditsAmount} credits to the user.`, ) .setFooter({ text: `Action by ${user.username}`, diff --git a/src/commands/manage/groups/credits/subcommands/take/index.ts b/src/commands/manage/groups/credits/subcommands/take/index.ts index eb815d96..d843f8b8 100644 --- a/src/commands/manage/groups/credits/subcommands/take/index.ts +++ b/src/commands/manage/groups/credits/subcommands/take/index.ts @@ -19,7 +19,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("user") .setDescription("The user to take credits from.") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option @@ -27,12 +27,12 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription(`The amount of credits to take.`) .setRequired(true) .setMinValue(1) - .setMaxValue(2147483647) + .setMaxValue(2147483647), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { const { guild, options, user } = interaction; @@ -55,7 +55,7 @@ export const execute = async ( .setColor(process.env.EMBED_COLOR_SUCCESS) .setAuthor({ name: "💳 Credits Manager" }) .setDescription( - ` Successfully took ${creditsAmount} credits to the user.` + ` Successfully took ${creditsAmount} credits to the user.`, ) .setFooter({ text: `Action by ${user.username}`, diff --git a/src/commands/manage/groups/credits/subcommands/transfer/index.ts b/src/commands/manage/groups/credits/subcommands/transfer/index.ts index 9a0a00e1..74b3f345 100644 --- a/src/commands/manage/groups/credits/subcommands/transfer/index.ts +++ b/src/commands/manage/groups/credits/subcommands/transfer/index.ts @@ -19,13 +19,13 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("from-user") .setDescription("The user to take credits from.") - .setRequired(true) + .setRequired(true), ) .addUserOption((option) => option .setName("to-user") .setDescription("The user to give credits to.") - .setRequired(true) + .setRequired(true), ) .addIntegerOption((option) => option @@ -33,12 +33,12 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription(`The amount of credits to set.`) .setRequired(true) .setMinValue(1) - .setMaxValue(2147483647) + .setMaxValue(2147483647), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { const { guild, options, user } = interaction; @@ -61,7 +61,7 @@ export const execute = async ( guild, fromUser, toUser, - creditsAmount + creditsAmount, ); // Constructing the transfer embed @@ -84,7 +84,7 @@ export const execute = async ( name: "🪙 Recipient Balance", value: `${transactionResult.toTransaction.balance}`, inline: true, - } + }, ) .setAuthor({ name: "This is an administrative action." }) //.setThumbnail(user.displayAvatarURL()) diff --git a/src/commands/moderation/subcommands/prune/index.ts b/src/commands/moderation/subcommands/prune/index.ts index db112d74..6dedb479 100644 --- a/src/commands/moderation/subcommands/prune/index.ts +++ b/src/commands/moderation/subcommands/prune/index.ts @@ -21,12 +21,12 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription("How many messages you wish to prune") .setRequired(true) .setMinValue(1) - .setMaxValue(99) + .setMaxValue(99), ) .addBooleanOption((option) => option .setName("bots") - .setDescription("Should bot messages be pruned too?") + .setDescription("Should bot messages be pruned too?"), ); }; @@ -43,7 +43,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { const bots = options.getBoolean("bots"); if (!count || count < 1 || count > 99) { throw new Error( - "Please provide a number between 1 and 99 for the prune command." + "Please provide a number between 1 and 99 for the prune command.", ); } @@ -55,7 +55,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { let filteredMessages = messages; if (!bots) { filteredMessages = filteredMessages.filter( - (message) => !message.author.bot + (message) => !message.author.bot, ); } return filteredMessages; @@ -71,7 +71,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { .setColor(process.env.EMBED_COLOR_SUCCESS) .setAuthor({ name: "🤖 Moderation" }) .setDescription( - `Successfully deleted ${messagesToDeleteArray.length} messages.` + `Successfully deleted ${messagesToDeleteArray.length} messages.`, ) .setFooter({ text: `Action by ${user.username}`, diff --git a/src/commands/quotes/subcommands/post/index.ts b/src/commands/quotes/subcommands/post/index.ts index 644ac84d..4c547e60 100644 --- a/src/commands/quotes/subcommands/post/index.ts +++ b/src/commands/quotes/subcommands/post/index.ts @@ -22,18 +22,18 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("user") .setDescription("The user who said this") - .setRequired(true) + .setRequired(true), ) .addStringOption((option) => option .setName("message") .setDescription("What the user said") - .setRequired(true) + .setRequired(true), ); }; export const execute = async ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ): Promise => { await deferReply(interaction, true); @@ -44,7 +44,7 @@ export const execute = async ( const quoteString = options.getString("message", true); if (quoteUser.id == user.id) throw new Error("One cannot quote oneself."); - + await upsertGuildMember(guild, user); await upsertGuildMember(guild, quoteUser); @@ -58,7 +58,7 @@ export const execute = async ( throw new Error("Quotes are disabled in this server."); const channel = await interaction.client.channels.fetch( - guildQuotesSettings.quoteChannelId + guildQuotesSettings.quoteChannelId, ); if (!channel) throw new Error("No channel found."); @@ -102,6 +102,6 @@ export const execute = async ( await generateCooldownName(interaction), guild, user, - addMinutes(new Date(), 5) + addMinutes(new Date(), 5), ); }; diff --git a/src/commands/reputation/index.ts b/src/commands/reputation/index.ts index 8c02645b..55e584c8 100644 --- a/src/commands/reputation/index.ts +++ b/src/commands/reputation/index.ts @@ -15,7 +15,7 @@ const subcommandHandlers: SubcommandHandlers = { export const builder = new SlashCommandBuilder() .setName("reputation") .setDescription( - "See and give reputation to users to show others how trustworthy they are" + "See and give reputation to users to show others how trustworthy they are", ) .setDMPermission(false) .addSubcommand(repute.builder) diff --git a/src/commands/reputation/subcommands/check/index.ts b/src/commands/reputation/subcommands/check/index.ts index 6259da88..b8236963 100644 --- a/src/commands/reputation/subcommands/check/index.ts +++ b/src/commands/reputation/subcommands/check/index.ts @@ -17,7 +17,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("user") .setDescription("The user you are checking") - .setRequired(false) + .setRequired(false), ); }; @@ -41,7 +41,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { `**Reputation:**\n` + `- Negative: ${userReputation.negative}\n` + `- Positive: ${userReputation.positive}\n` + - `- Total: ${userReputation.total}` + `- Total: ${userReputation.total}`, ) .setFooter({ text: `Requested by ${user.username}`, diff --git a/src/commands/reputation/subcommands/repute/index.ts b/src/commands/reputation/subcommands/repute/index.ts index 3708b113..3a213162 100644 --- a/src/commands/reputation/subcommands/repute/index.ts +++ b/src/commands/reputation/subcommands/repute/index.ts @@ -21,7 +21,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { option .setName("user") .setDescription("The user you repute") - .setRequired(true) + .setRequired(true), ) .addStringOption((option) => option @@ -30,8 +30,8 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setRequired(true) .addChoices( { name: "Positive", value: "positive" }, - { name: "Negative", value: "negative" } - ) + { name: "Negative", value: "negative" }, + ), ); }; @@ -48,7 +48,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { if (!targetUser) { throw new Error( - "Sorry, we were unable to find the user you are trying to give reputation to." + "Sorry, we were unable to find the user you are trying to give reputation to.", ); } @@ -83,6 +83,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { await generateCooldownName(interaction), guild, user, - addDays(new Date(), 1) + addDays(new Date(), 1), ); }; diff --git a/src/commands/settings/subcommands/credits/index.ts b/src/commands/settings/subcommands/credits/index.ts index aeda8412..7d381887 100644 --- a/src/commands/settings/subcommands/credits/index.ts +++ b/src/commands/settings/subcommands/credits/index.ts @@ -19,7 +19,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription("work-bonus-chance") .setRequired(true) .setMinValue(0) - .setMaxValue(100) + .setMaxValue(100), ) .addNumberOption((option) => option @@ -27,7 +27,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription("work-penalty-chance") .setRequired(true) .setMinValue(0) - .setMaxValue(100) + .setMaxValue(100), ); }; @@ -103,7 +103,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { name: "Work Penalty Chance", value: `${upsertGuildCreditsSettings.workPenaltyChance}`, inline: true, - } + }, ), ], }); diff --git a/src/commands/settings/subcommands/ctrlpanel/index.ts b/src/commands/settings/subcommands/ctrlpanel/index.ts index 130b8b8a..8562f4c3 100644 --- a/src/commands/settings/subcommands/ctrlpanel/index.ts +++ b/src/commands/settings/subcommands/ctrlpanel/index.ts @@ -23,14 +23,14 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setRequired(true) .addChoices( { name: "HTTPS (secure)", value: "https" }, - { name: "HTTP (insecure)", value: "http" } - ) + { name: "HTTP (insecure)", value: "http" }, + ), ) .addStringOption((option) => - option.setName("domain").setDescription("API domain").setRequired(true) + option.setName("domain").setDescription("API domain").setRequired(true), ) .addStringOption((option) => - option.setName("token").setDescription("API Token").setRequired(true) + option.setName("token").setDescription("API Token").setRequired(true), ); }; diff --git a/src/commands/settings/subcommands/quotes/index.ts b/src/commands/settings/subcommands/quotes/index.ts index 5b086fb5..6e3ae2f1 100644 --- a/src/commands/settings/subcommands/quotes/index.ts +++ b/src/commands/settings/subcommands/quotes/index.ts @@ -14,10 +14,10 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setName("quotes") .setDescription("Configure quotes module") .addBooleanOption((option) => - option.setName("status").setDescription("Status").setRequired(true) + option.setName("status").setDescription("Status").setRequired(true), ) .addChannelOption((option) => - option.setName("channel").setDescription("channel").setRequired(true) + option.setName("channel").setDescription("channel").setRequired(true), ); }; diff --git a/src/commands/shop/subcommands/ctrlpanel.ts b/src/commands/shop/subcommands/ctrlpanel.ts index e454483b..d131ad90 100644 --- a/src/commands/shop/subcommands/ctrlpanel.ts +++ b/src/commands/shop/subcommands/ctrlpanel.ts @@ -25,7 +25,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .setDescription("How much credits you want to withdraw.") .setRequired(true) .setMinValue(100) - .setMaxValue(999999) + .setMaxValue(999999), ); }; @@ -45,7 +45,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { const { redeemUrl } = await ctrlPanelAPI.generateVoucher( voucherCode, withdrawalAmount, - 1 + 1, ); const userDM = await client.users.fetch(user.id); @@ -67,7 +67,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { .setURL(redeemUrl); const actionRow = new ActionRowBuilder().addComponents( - redemptionButton + redemptionButton, ); const dmMessage: Message = await userDM.send({ diff --git a/src/commands/utils/subcommands/about/index.ts b/src/commands/utils/subcommands/about/index.ts index eb11307c..43227f81 100644 --- a/src/commands/utils/subcommands/about/index.ts +++ b/src/commands/utils/subcommands/about/index.ts @@ -28,7 +28,7 @@ export const execute = async (interaction: CommandInteraction) => { const guildCount = client.guilds.cache.size; const memberCount = client.guilds.cache.reduce( (a, g) => a + g.memberCount, - 0 + 0, ); const version = process.env.npm_package_version; @@ -42,7 +42,7 @@ export const execute = async (interaction: CommandInteraction) => { .setLabel("Discord Server") .setStyle(ButtonStyle.Link) .setEmoji("💬") - .setURL("https://discord.zyner.org") + .setURL("https://discord.zyner.org"), ); const uptimeDuration = intervalToDuration({ diff --git a/src/commands/utils/subcommands/avatar/index.ts b/src/commands/utils/subcommands/avatar/index.ts index 975167e8..c4997bc2 100644 --- a/src/commands/utils/subcommands/avatar/index.ts +++ b/src/commands/utils/subcommands/avatar/index.ts @@ -13,7 +13,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => { .addUserOption((option) => option .setName("user") - .setDescription("The user whose avatar you want to check") + .setDescription("The user whose avatar you want to check"), ); }; @@ -45,7 +45,7 @@ export const execute = async (interaction: CommandInteraction) => { .setDescription( userOption ? `You can also [download it here](${avatarUrl})!` - : `Your avatar is available to [download here](${avatarUrl}).` + : `Your avatar is available to [download here](${avatarUrl}).`, ) .setThumbnail(avatarUrl) .setColor(process.env.EMBED_COLOR_SUCCESS), diff --git a/src/events/interactionCreate/interactionTypes/button/index.ts b/src/events/interactionCreate/interactionTypes/button/index.ts index a69ceefa..7afcfbe9 100644 --- a/src/events/interactionCreate/interactionTypes/button/index.ts +++ b/src/events/interactionCreate/interactionTypes/button/index.ts @@ -2,7 +2,7 @@ import { ButtonInteraction } from "discord.js"; import interactionErrorHandler from "../../../../handlers/interactionErrorHandler"; export default async function handleButtonInteraction( - interaction: ButtonInteraction + interaction: ButtonInteraction, ) { const { customId } = interaction; diff --git a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleCooldown.ts b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleCooldown.ts index 6ec00e4c..eeb37bb1 100644 --- a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleCooldown.ts +++ b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleCooldown.ts @@ -13,7 +13,7 @@ export default async function handleCooldown( interaction: CommandInteraction, guildCooldown: Cooldown | null, userCooldown: Cooldown | null, - guildMemberCooldown: Cooldown | null + guildMemberCooldown: Cooldown | null, ) { const cooldown = guildCooldown || userCooldown || guildMemberCooldown; @@ -44,7 +44,7 @@ function createButtons() { .setLabel("Report Problem") .setStyle(ButtonStyle.Link) .setEmoji("✏️") - .setURL("https://discord.zyner.org") + .setURL("https://discord.zyner.org"), ); } @@ -52,7 +52,7 @@ function createCooldownEmbed(timeLeft: string, cooldownId: string) { return new EmbedBuilder() .setAuthor({ name: "⚠️ | Request Failed" }) .setDescription( - `Sorry, but you're currently on cooldown. Please try again later.\n\nRemaining cooldown time: ${timeLeft}` + `Sorry, but you're currently on cooldown. Please try again later.\n\nRemaining cooldown time: ${timeLeft}`, ) .setColor("#FF6699") .setTimestamp() diff --git a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleUnavailableCommand.ts b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleUnavailableCommand.ts index e9ec2dcf..b67bcd0e 100644 --- a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleUnavailableCommand.ts +++ b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/handlers/handleUnavailableCommand.ts @@ -10,7 +10,7 @@ import sendResponse from "../../../../../utils/sendResponse"; export default async function handleUnavailableCommand( interaction: CommandInteraction, - commandName: string + commandName: string, ) { const commandErrorMessage = `Command '${commandName}' is unavailable`; logger.error(commandErrorMessage); @@ -26,7 +26,7 @@ export default async function handleUnavailableCommand( .setLabel("Report Problem") .setStyle(ButtonStyle.Link) .setEmoji("✏️") - .setURL("https://discord.zyner.org") + .setURL("https://discord.zyner.org"), ); const response = { diff --git a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/index.ts b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/index.ts index 68a22710..46ad2aff 100644 --- a/src/events/interactionCreate/interactionTypes/handleCommandInteraction/index.ts +++ b/src/events/interactionCreate/interactionTypes/handleCommandInteraction/index.ts @@ -11,7 +11,7 @@ const commandLocks = new Map(); const cooldownManager = new CooldownManager(); export default async function handleCommandInteraction( - interaction: CommandInteraction + interaction: CommandInteraction, ) { if (!interaction.isCommand()) { return; @@ -31,7 +31,7 @@ export default async function handleCommandInteraction( // Check if the identifier is already locked if (commandLocks.has(cooldownItem)) { throw new Error( - "You are unable to execute the same command simultaneously." + "You are unable to execute the same command simultaneously.", ); } @@ -47,7 +47,7 @@ export default async function handleCommandInteraction( interaction, guildCooldown, userCooldown, - guildMemberCooldown + guildMemberCooldown, ); return; } diff --git a/src/events/messageCreate/components/earnCredits.ts b/src/events/messageCreate/components/earnCredits.ts index d79647c5..144e984d 100644 --- a/src/events/messageCreate/components/earnCredits.ts +++ b/src/events/messageCreate/components/earnCredits.ts @@ -20,7 +20,7 @@ export default async (message: Message) => { if (await isUserOnCooldown(guild, author)) { logger.verbose( - `User "${author.username}" is on cooldown for "${cooldownName}" in guild "${guild.name}"` + `User "${author.username}" is on cooldown for "${cooldownName}" in guild "${guild.name}"`, ); return; } @@ -61,7 +61,7 @@ export default async (message: Message) => { logger.error( `Failed to give credits to user ${author.username} in guild ${ guild.name - } when sending a message: ${String(error)}` + } when sending a message: ${String(error)}`, ); } }; @@ -70,7 +70,7 @@ function isMessageValid( guild: Guild, author: User, channel: Channel, - content: string + content: string, ): boolean { return ( guild && @@ -85,7 +85,7 @@ async function isUserOnCooldown(guild: Guild, author: User): Promise { const cooldownActive = await cooldownManager.checkCooldown( cooldownName, guild, - author + author, ); if (!cooldownActive) return false; @@ -98,6 +98,6 @@ async function setCooldown(guild: Guild, user: User) { cooldownName, guild, user, - addSeconds(new Date(), 5) + addSeconds(new Date(), 5), ); } diff --git a/src/events/ready/importOldData.ts b/src/events/ready/importOldData.ts index 52096e99..482a3538 100644 --- a/src/events/ready/importOldData.ts +++ b/src/events/ready/importOldData.ts @@ -28,7 +28,7 @@ export default async (client: Client) => { // Fetch all channels in the guild const channels = guild.channels.cache.filter( - (channel) => channel.type === ChannelType.GuildText + (channel) => channel.type === ChannelType.GuildText, ); // Object to store message counts per user @@ -59,7 +59,7 @@ export default async (client: Client) => { } else { messageCounts[userId]++; logger.silly( - `Guild: ${message.guild.name} User: ${message.author.username} => ${messageCounts[userId]}` + `Guild: ${message.guild.name} User: ${message.author.username} => ${messageCounts[userId]}`, ); } } @@ -124,11 +124,11 @@ export default async (client: Client) => { await creditsManager.set( member.guild, member.user, - messageCounts[userId] + messageCounts[userId], ); logger.info( - `${member?.user.username}: ${messageCounts[userId]} messages` + `${member?.user.username}: ${messageCounts[userId]} messages`, ); } catch (error: unknown) { if (error.code === 429) { diff --git a/src/handlers/CooldownManager.ts b/src/handlers/CooldownManager.ts index 0f713573..168f227b 100644 --- a/src/handlers/CooldownManager.ts +++ b/src/handlers/CooldownManager.ts @@ -8,7 +8,7 @@ class CooldownManager { cooldownItem: string, guild: Guild | null, user: User | null, - expiresAt: Date + expiresAt: Date, ): Promise { const data = { cooldownItem, @@ -20,7 +20,7 @@ class CooldownManager { const existingCooldown = await this.checkCooldown( cooldownItem, guild, - user + user, ); if (existingCooldown) { @@ -38,11 +38,11 @@ class CooldownManager { if (guild && user) { logger.verbose( - `Set guild member cooldown: ${cooldownItem} in guild ${guild.id} for user ${user.id}` + `Set guild member cooldown: ${cooldownItem} in guild ${guild.id} for user ${user.id}`, ); } else if (guild) { logger.verbose( - `Set guild cooldown: ${cooldownItem} in guild ${guild.id}` + `Set guild cooldown: ${cooldownItem} in guild ${guild.id}`, ); } else if (user) { logger.verbose(`Set user cooldown: ${cooldownItem} for user ${user.id}`); @@ -52,7 +52,7 @@ class CooldownManager { async checkCooldown( cooldownItem: string, guild: Guild | null, - user: User | null + user: User | null, ): Promise { const start = Date.now(); const where = { @@ -65,15 +65,15 @@ class CooldownManager { if (guild && user) { logger.verbose( - `Checked guild member cooldown: ${cooldownItem} in guild ${guild.id} for user ${user.id}. Duration: ${duration}ms` + `Checked guild member cooldown: ${cooldownItem} in guild ${guild.id} for user ${user.id}. Duration: ${duration}ms`, ); } else if (guild) { logger.verbose( - `Checked guild cooldown: ${cooldownItem} in guild ${guild.id}. Duration: ${duration}ms` + `Checked guild cooldown: ${cooldownItem} in guild ${guild.id}. Duration: ${duration}ms`, ); } else if (user) { logger.verbose( - `Checked user cooldown: ${cooldownItem} for user ${user.id}. Duration: ${duration}ms` + `Checked user cooldown: ${cooldownItem} for user ${user.id}. Duration: ${duration}ms`, ); } @@ -83,7 +83,7 @@ class CooldownManager { async checkCooldowns( cooldownItem: string, guild: Guild | null, - user: User | null + user: User | null, ): Promise<{ guildCooldown: Cooldown | null; userCooldown: Cooldown | null; diff --git a/src/handlers/CreditsManager.ts b/src/handlers/CreditsManager.ts index 1c49d681..d5b0251b 100644 --- a/src/handlers/CreditsManager.ts +++ b/src/handlers/CreditsManager.ts @@ -63,7 +63,7 @@ class CreditsManager { async give(guild: Guild, user: User, amount: number) { try { logger.debug( - `Starting give transaction for guild: ${guild.id}, user: ${user.id}` + `Starting give transaction for guild: ${guild.id}, user: ${user.id}`, ); const recipient = await prisma.$transaction(async (tx) => { @@ -80,7 +80,7 @@ class CreditsManager { if (existingRecipient && existingRecipient.balance > 2147483647) { throw new Error( - "Oops! That's more credits than the user can have. The maximum allowed is 2,147,483,647." + "Oops! That's more credits than the user can have. The maximum allowed is 2,147,483,647.", ); } @@ -131,7 +131,7 @@ class CreditsManager { }); logger.debug( - `Give transaction completed for guild: ${guild.id}, user: ${user.id}` + `Give transaction completed for guild: ${guild.id}, user: ${user.id}`, ); return recipient; @@ -144,7 +144,7 @@ class CreditsManager { async take(guild: Guild, user: User, amount: number) { try { logger.debug( - `Starting take transaction for guild: ${guild.id}, user: ${user.id}` + `Starting take transaction for guild: ${guild.id}, user: ${user.id}`, ); const recipient = await prisma.$transaction(async (tx) => { @@ -210,7 +210,7 @@ class CreditsManager { }); logger.debug( - `Take transaction completed for guild: ${guild.id}, user: ${user.id}` + `Take transaction completed for guild: ${guild.id}, user: ${user.id}`, ); return recipient; @@ -223,7 +223,7 @@ class CreditsManager { async set(guild: Guild, user: User, amount: number) { try { logger.debug( - `Starting set transaction for guild: ${guild.id}, user: ${user.id}` + `Starting set transaction for guild: ${guild.id}, user: ${user.id}`, ); const recipient = await prisma.$transaction(async (tx) => { @@ -274,7 +274,7 @@ class CreditsManager { }); logger.debug( - `Set transaction completed for guild: ${guild.id}, user: ${user.id}` + `Set transaction completed for guild: ${guild.id}, user: ${user.id}`, ); return recipient; @@ -410,13 +410,13 @@ class CreditsManager { if (!updatedFromTransaction) { throw new Error( - "Failed to fetch the updated sender's transaction record." + "Failed to fetch the updated sender's transaction record.", ); } if (!updatedToTransaction) { throw new Error( - "Failed to fetch the updated recipient's transaction record." + "Failed to fetch the updated recipient's transaction record.", ); } @@ -429,7 +429,7 @@ class CreditsManager { }; } catch (error: any) { logger.error( - `Error in transaction for guild: ${guild.id}, sender: ${fromUser.id}, recipient: ${toUser.id}: ${error.message}` + `Error in transaction for guild: ${guild.id}, sender: ${fromUser.id}, recipient: ${toUser.id}: ${error.message}`, ); throw error; } diff --git a/src/handlers/executeSubcommand.ts b/src/handlers/executeSubcommand.ts index 06a6e0cf..5b13a8dd 100644 --- a/src/handlers/executeSubcommand.ts +++ b/src/handlers/executeSubcommand.ts @@ -2,7 +2,7 @@ import { ChatInputCommandInteraction } from "discord.js"; export interface SubcommandHandlers { [subcommand: string]: ( - interaction: ChatInputCommandInteraction + interaction: ChatInputCommandInteraction, ) => Promise; } @@ -13,7 +13,7 @@ export interface SubcommandGroupHandlers { export const executeSubcommand = async ( interaction: ChatInputCommandInteraction, subcommandHandlers: SubcommandHandlers, - subcommandGroupHandlers?: SubcommandGroupHandlers + subcommandGroupHandlers?: SubcommandGroupHandlers, ) => { const subcommandGroup = interaction.options.getSubcommandGroup(); if (subcommandGroupHandlers && subcommandGroup) { diff --git a/src/handlers/interactionErrorHandler.ts b/src/handlers/interactionErrorHandler.ts index 8905e378..a303ce1d 100644 --- a/src/handlers/interactionErrorHandler.ts +++ b/src/handlers/interactionErrorHandler.ts @@ -11,7 +11,7 @@ import sendResponse from "../utils/sendResponse"; export default async ( interaction: CommandInteraction | ButtonInteraction, - error: unknown + error: unknown, ) => { if (error instanceof Error) { const buttons = new ActionRowBuilder().addComponents( @@ -19,14 +19,14 @@ export default async ( .setLabel("Report Problem") .setStyle(ButtonStyle.Link) .setEmoji("✏️") - .setURL("https://discord.zyner.org") + .setURL("https://discord.zyner.org"), ); const errorEmbed = new EmbedBuilder() .setAuthor({ name: "⚠️ | Request Failed" }) .setDescription( error.message ?? - "An error occurred while processing your request. Please try again later." + "An error occurred while processing your request. Please try again later.", ) .setColor("#FFCC66") .setTimestamp(); diff --git a/src/handlers/registerCommands.ts b/src/handlers/registerCommands.ts index f99d54ec..0527e859 100644 --- a/src/handlers/registerCommands.ts +++ b/src/handlers/registerCommands.ts @@ -47,7 +47,7 @@ export default async (client: Client) => { level: "error", }); } - }) + }), ); await Promise.all([ diff --git a/src/handlers/registerEvents.ts b/src/handlers/registerEvents.ts index 6f6421f9..871eab7c 100644 --- a/src/handlers/registerEvents.ts +++ b/src/handlers/registerEvents.ts @@ -42,7 +42,7 @@ export default async (client: Client) => { } catch (error) { logger.error( `Error occurred while registering event '${name}':`, - error + error, ); } }; diff --git a/src/handlers/updatePresence.ts b/src/handlers/updatePresence.ts index c0e193a3..9cc16247 100644 --- a/src/handlers/updatePresence.ts +++ b/src/handlers/updatePresence.ts @@ -10,7 +10,7 @@ export default async (client: Client) => { const memberCount = guilds.cache.reduce( (acc, guild) => acc + (guild.memberCount || 0), - 0 + 0, ); const guildCount = guilds.cache.size; diff --git a/src/helpers/upsertApiCredentials.ts b/src/helpers/upsertApiCredentials.ts index 02d635a3..595c1372 100644 --- a/src/helpers/upsertApiCredentials.ts +++ b/src/helpers/upsertApiCredentials.ts @@ -9,7 +9,7 @@ export const upsertApiCredentials = async ( | Prisma.NullTypes.JsonNull | Prisma.InputJsonValue | Prisma.JsonObject - | Prisma.InputJsonObject + | Prisma.InputJsonObject, ) => { await prisma.apiCredentials.upsert({ where: { diff --git a/src/services/CtrlPanelAPI.ts b/src/services/CtrlPanelAPI.ts index 43c74269..27e508dd 100644 --- a/src/services/CtrlPanelAPI.ts +++ b/src/services/CtrlPanelAPI.ts @@ -42,7 +42,7 @@ class CtrlPanelAPI { if (!apiCredentials || !apiCredentials.credentials) { throw new CtrlPanelAPIError( - "API credentials are required for this functionality. Please configure the CtrlPanel.gg API credentials for this guild." + "API credentials are required for this functionality. Please configure the CtrlPanel.gg API credentials for this guild.", ); } @@ -70,7 +70,7 @@ class CtrlPanelAPI { public async generateVoucher( code: string, amount: number, - uses: number + uses: number, ): Promise<{ redeemUrl: string }> { await this.fetchApiCredentials(); @@ -97,7 +97,7 @@ class CtrlPanelAPI { public async updateApiCredentials( scheme: string, domain: string, - tokenData: string + tokenData: string, ): Promise { const url = await encryption.encrypt(`${scheme}://${domain}`); const token = await encryption.encrypt(tokenData); diff --git a/src/utils/deferReply.ts b/src/utils/deferReply.ts index 0ef6f1b9..b7ab69b6 100644 --- a/src/utils/deferReply.ts +++ b/src/utils/deferReply.ts @@ -7,7 +7,7 @@ import sendResponse from "./sendResponse"; export default async ( interaction: CommandInteraction | ButtonInteraction, - ephemeral: boolean + ephemeral: boolean, ) => { if (!interaction.isRepliable()) { throw new Error("Failed to reply to your request."); @@ -21,7 +21,7 @@ export default async ( .setTimestamp(new Date()) .setTitle("🎉︱Hold on tight!") .setDescription( - "We're working our magic. This might take a while, so prepare to be amazed! ✨" + "We're working our magic. This might take a while, so prepare to be amazed! ✨", ), ], }); diff --git a/src/utils/encryption.ts b/src/utils/encryption.ts index 4fa9e9e5..35f08a00 100644 --- a/src/utils/encryption.ts +++ b/src/utils/encryption.ts @@ -49,7 +49,7 @@ class Encryption { private transformData( data: Buffer, - transform: crypto.CipherGCM | crypto.DecipherGCM + transform: crypto.CipherGCM | crypto.DecipherGCM, ): Buffer { return Buffer.concat([transform.update(data), transform.final()]); } diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 83bce306..15c23aeb 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -14,7 +14,7 @@ const logger = winston.createLogger({ format: combine( errors({ stack: true }), timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), - json() + json(), ), transports: [ new winston.transports.DailyRotateFile({ @@ -24,7 +24,7 @@ const logger = winston.createLogger({ format: combine( errors({ stack: true }), timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), - json() + json(), ), }), new winston.transports.Console({ @@ -33,7 +33,7 @@ const logger = winston.createLogger({ colorize({ all: true }), timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), align(), - logFormat + logFormat, ), }), ], diff --git a/src/utils/sendResponse.ts b/src/utils/sendResponse.ts index d6c67f9f..eb058147 100644 --- a/src/utils/sendResponse.ts +++ b/src/utils/sendResponse.ts @@ -8,21 +8,21 @@ import logger from "./logger"; export default async ( interaction: CommandInteraction | ButtonInteraction, - response: InteractionReplyOptions | InteractionEditReplyOptions | string + response: InteractionReplyOptions | InteractionEditReplyOptions | string, ) => { try { if (interaction instanceof ButtonInteraction) { await (interaction as ButtonInteraction).reply( - response as InteractionReplyOptions + response as InteractionReplyOptions, ); } else { if (interaction.deferred) { await (interaction as CommandInteraction).editReply( - response as InteractionEditReplyOptions + response as InteractionEditReplyOptions, ); } else { await (interaction as CommandInteraction).reply( - response as InteractionReplyOptions + response as InteractionReplyOptions, ); } }