From 7d509e1b2266723570106bdd7f2b084435aaeb14 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 31 Dec 2023 11:08:49 +0100 Subject: [PATCH] Updated all files based on eslintrc --- src/commands/help.ts | 6 ++---- src/commands/staff/updatediscordroles.ts | 4 ++-- src/interfaces/Autocomplete.ts | 3 ++- src/interfaces/Button.ts | 1 + src/interfaces/Command.ts | 6 ++---- src/interfaces/ContextMenu.ts | 1 + src/interfaces/Event.ts | 1 + src/interfaces/Modal.ts | 1 + src/utils/Illegitimate.ts | 2 -- src/utils/functions/bedwars.ts | 16 ++++++++-------- src/utils/functions/hypixel.ts | 4 ++-- 11 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/commands/help.ts b/src/commands/help.ts index 4a2a2f9..19a92e4 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -12,7 +12,7 @@ export = { data: new SlashCommandBuilder() .setName("help") .setDescription("List's all commands usable by a member") - .setDMPermission(true), + .setDMPermission(false), async execute(interaction, client) { await interaction.deferReply({ ephemeral: true }) @@ -72,9 +72,7 @@ export = { fields: commandList, color: embedColor, thumbnail: { - url: interaction?.guild?.iconURL({ - forceStatic: true, - })!, + url: interaction.guild!.iconURL({ forceStatic: true, })!, }, footer: { icon_url: footerIcon!, diff --git a/src/commands/staff/updatediscordroles.ts b/src/commands/staff/updatediscordroles.ts index 19445b6..6dfeb3a 100644 --- a/src/commands/staff/updatediscordroles.ts +++ b/src/commands/staff/updatediscordroles.ts @@ -17,7 +17,7 @@ export async function updateDiscordRoles( await interaction.editReply({ embeds: [ { - description: `You do not have permission to use this command.`, + description: "You do not have permission to use this command.", color: embedColor, }, ], @@ -196,7 +196,7 @@ export async function updateDiscordRoles( await interaction.editReply({ embeds: [ { - description: `Successfully updated all roles.`, + description: "Successfully updated all roles.", color: embedColor, }, ], diff --git a/src/interfaces/Autocomplete.ts b/src/interfaces/Autocomplete.ts index e18ef1d..284d6cb 100644 --- a/src/interfaces/Autocomplete.ts +++ b/src/interfaces/Autocomplete.ts @@ -4,5 +4,6 @@ export default interface Autocomplete { name: string description: string type: "autocomplete" - execute: (interaction: AutocompleteInteraction) => Promise + // eslint-disable-next-line no-unused-vars + execute: (interacion: AutocompleteInteraction) => Promise } diff --git a/src/interfaces/Button.ts b/src/interfaces/Button.ts index 5dd5853..f4024d9 100644 --- a/src/interfaces/Button.ts +++ b/src/interfaces/Button.ts @@ -4,5 +4,6 @@ export default interface Button { name: string description: string type: "button" + // eslint-disable-next-line no-unused-vars execute: (interaction: ButtonInteraction) => Promise } diff --git a/src/interfaces/Command.ts b/src/interfaces/Command.ts index 2985deb..4a3239a 100644 --- a/src/interfaces/Command.ts +++ b/src/interfaces/Command.ts @@ -12,8 +12,6 @@ export default interface Command { "addSubcommand" | "addSubcommandGroup" | "addIntegerOption" > subcommands?: boolean - execute: ( - interaction: ChatInputCommandInteraction, - client: Client, - ) => Promise + // eslint-disable-next-line no-unused-vars + execute: ( interaction: ChatInputCommandInteraction, client: Client,) => Promise } diff --git a/src/interfaces/ContextMenu.ts b/src/interfaces/ContextMenu.ts index 3c87590..a9eb460 100644 --- a/src/interfaces/ContextMenu.ts +++ b/src/interfaces/ContextMenu.ts @@ -9,5 +9,6 @@ export default interface ContextMenu { type: "contextmenu" dev?: boolean data: ContextMenuCommandBuilder + // eslint-disable-next-line no-unused-vars execute: (interaction: ContextMenuCommandInteraction) => Promise } diff --git a/src/interfaces/Event.ts b/src/interfaces/Event.ts index 6ba4716..cd2085d 100644 --- a/src/interfaces/Event.ts +++ b/src/interfaces/Event.ts @@ -5,5 +5,6 @@ export default interface Event { description: string type: "event" event: keyof ClientEvents + // eslint-disable-next-line no-unused-vars execute(...args: any[]): void } diff --git a/src/interfaces/Modal.ts b/src/interfaces/Modal.ts index 34a4047..d0e8271 100644 --- a/src/interfaces/Modal.ts +++ b/src/interfaces/Modal.ts @@ -4,5 +4,6 @@ export default interface Modal { name: string description: string type: "modal" + // eslint-disable-next-line no-unused-vars execute: (interaction: ModalSubmitInteraction) => Promise } diff --git a/src/utils/Illegitimate.ts b/src/utils/Illegitimate.ts index 8400c53..de10feb 100644 --- a/src/utils/Illegitimate.ts +++ b/src/utils/Illegitimate.ts @@ -8,8 +8,6 @@ const client = new Client() const redis = new Redis(env.prod.redisURI!) class Bot { - constructor() {} - async start() { init() client.start() diff --git a/src/utils/functions/bedwars.ts b/src/utils/functions/bedwars.ts index c8ba341..03d5657 100644 --- a/src/utils/functions/bedwars.ts +++ b/src/utils/functions/bedwars.ts @@ -10,14 +10,14 @@ function getExpForLevel(level: number): number { } switch (respectedLevel) { - case 1: - return 500 - case 2: - return 1000 - case 3: - return 2000 - case 4: - return 3500 + case 1: + return 500 + case 2: + return 1000 + case 3: + return 2000 + case 4: + return 3500 } return 5000 } diff --git a/src/utils/functions/hypixel.ts b/src/utils/functions/hypixel.ts index 6a20240..93465d3 100644 --- a/src/utils/functions/hypixel.ts +++ b/src/utils/functions/hypixel.ts @@ -12,10 +12,10 @@ function getLevel(exp: number): number { return exp <= 1 ? 1 : Math.floor( - 1 + + 1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp), - ) + ) } function hypixelLevel(exp: number): number {