From 572f53f010f04b5d43cae0e51a70a6be6611c61b Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 23 Nov 2023 21:33:44 +0100 Subject: [PATCH] Updated eslintrc and fixed errors in files --- .eslintrc.js | 2 +- src/commands/devel.js | 16 ++-------------- src/commands/help.js | 2 +- src/commands/setup.js | 2 -- src/commands/verify.js | 6 +++--- src/utils/functions/skywars.js | 2 +- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ed4abb9..fc7090b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { "env": { - "browser": true, + "node": true, "commonjs": true, "es2021": true }, diff --git a/src/commands/devel.js b/src/commands/devel.js index 9c573eb..d857163 100644 --- a/src/commands/devel.js +++ b/src/commands/devel.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, PermissionFlagsBits, userMention, EmbedBuilder, ChannelType } = require("discord.js") +const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js") module.exports = { name: "admin", @@ -12,18 +12,6 @@ module.exports = { subcommand .setName("reload") .setDescription("Reload the bot.")) - .addSubcommand(subcommand => - subcommand - .setName("listallverified") - .setDescription("List all verified users.")) - .addSubcommand(subcommand => - subcommand - .setName("purgereactions") - .setDescription("Purge all reactions from a messages.") - .addIntegerOption(option => - option - .setName("count") - .setDescription("Count of messages to purge reactions from."))) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), @@ -38,7 +26,7 @@ module.exports = { const { exec } = require("child_process") await interaction.reply({ content: "Reloading...", ephemeral: true }) - exec("pm2 restart 0", async (err, stdout, stderr) => { + exec("pm2 restart 0", async (err) => { if (err) { await interaction.reply({ content: "Error while reloading: " + err, ephemeral: true }) } diff --git a/src/commands/help.js b/src/commands/help.js index 3d2120c..351941a 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ChannelType } = require("discord.js") +const { SlashCommandBuilder } = require("discord.js") const { color } = require("../../config/options.json") module.exports = { diff --git a/src/commands/setup.js b/src/commands/setup.js index 0cbac3e..7367363 100644 --- a/src/commands/setup.js +++ b/src/commands/setup.js @@ -62,8 +62,6 @@ module.exports = { /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { - const user = interaction.user - const guild = interaction.guild const subcommand = interaction.options.getSubcommand() const embedColor = Number(color.replace("#", "0x")) diff --git a/src/commands/verify.js b/src/commands/verify.js index b39408c..491e40e 100644 --- a/src/commands/verify.js +++ b/src/commands/verify.js @@ -79,7 +79,7 @@ module.exports = { interaction.editReply({ embeds: [ { - description: " There is no Discord account linked to `" + stats.data.player.displayname + "`.\n\n" + + description: " There is no Discord account linked to `" + player.displayname + "`.\n\n" + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", color: embedColor } @@ -92,7 +92,7 @@ module.exports = { interaction.editReply({ embeds: [ { - description: " There is no Discord account linked to `" + stats.data.player.displayname + "`.\n\n" + + description: " There is no Discord account linked to `" + player.displayname + "`.\n\n" + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", color: embedColor } @@ -107,7 +107,7 @@ module.exports = { interaction.editReply({ embeds: [ { - description: " The Discord account linked to `" + stats.data.player.displayname + "` is currently `" + linkedDiscord + "`\n\n" + + description: " The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" + "**Please set your Discord tag on hypixel to `" + username + "` and try again.**", color: embedColor } diff --git a/src/utils/functions/skywars.js b/src/utils/functions/skywars.js index 8e236ee..3c2baf0 100644 --- a/src/utils/functions/skywars.js +++ b/src/utils/functions/skywars.js @@ -8,7 +8,7 @@ function skywarsLevel(xp) { exactLevel = (xp - 15000) / 10000 + 12 return exactLevel } else { - for (i = 0; i < xps.length; i++) { + for (let i = 0; i < xps.length; i++) { if (xp < xps[i]) { exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1]) return exactLevel