Updated eslintrc and fixed errors in files

This commit is contained in:
2023-11-23 21:33:44 +01:00
parent 0eeb48b2dd
commit 572f53f010
6 changed files with 8 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
module.exports = { module.exports = {
"env": { "env": {
"browser": true, "node": true,
"commonjs": true, "commonjs": true,
"es2021": true "es2021": true
}, },

View File

@@ -1,4 +1,4 @@
const { SlashCommandBuilder, PermissionFlagsBits, userMention, EmbedBuilder, ChannelType } = require("discord.js") const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js")
module.exports = { module.exports = {
name: "admin", name: "admin",
@@ -12,18 +12,6 @@ module.exports = {
subcommand subcommand
.setName("reload") .setName("reload")
.setDescription("Reload the bot.")) .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) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -38,7 +26,7 @@ module.exports = {
const { exec } = require("child_process") const { exec } = require("child_process")
await interaction.reply({ content: "Reloading...", ephemeral: true }) await interaction.reply({ content: "Reloading...", ephemeral: true })
exec("pm2 restart 0", async (err, stdout, stderr) => { exec("pm2 restart 0", async (err) => {
if (err) { if (err) {
await interaction.reply({ content: "Error while reloading: " + err, ephemeral: true }) await interaction.reply({ content: "Error while reloading: " + err, ephemeral: true })
} }

View File

@@ -1,4 +1,4 @@
const { SlashCommandBuilder, ChannelType } = require("discord.js") const { SlashCommandBuilder } = require("discord.js")
const { color } = require("../../config/options.json") const { color } = require("../../config/options.json")
module.exports = { module.exports = {

View File

@@ -62,8 +62,6 @@ module.exports = {
/** @param { import('discord.js').ChatInputCommandInteraction } interaction */ /** @param { import('discord.js').ChatInputCommandInteraction } interaction */
async execute(interaction) { async execute(interaction) {
const user = interaction.user
const guild = interaction.guild
const subcommand = interaction.options.getSubcommand() const subcommand = interaction.options.getSubcommand()
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))

View File

@@ -79,7 +79,7 @@ module.exports = {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [
{ {
description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + stats.data.player.displayname + "`.\n\n" + description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + player.displayname + "`.\n\n" +
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**", "**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
color: embedColor color: embedColor
} }
@@ -92,7 +92,7 @@ module.exports = {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [
{ {
description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + stats.data.player.displayname + "`.\n\n" + description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + player.displayname + "`.\n\n" +
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**", "**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
color: embedColor color: embedColor
} }
@@ -107,7 +107,7 @@ module.exports = {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [
{ {
description: "<a:cross_a:1087808606897983539> The Discord account linked to `" + stats.data.player.displayname + "` is currently `" + linkedDiscord + "`\n\n" + description: "<a:cross_a:1087808606897983539> The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" +
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**", "**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
color: embedColor color: embedColor
} }

View File

@@ -8,7 +8,7 @@ function skywarsLevel(xp) {
exactLevel = (xp - 15000) / 10000 + 12 exactLevel = (xp - 15000) / 10000 + 12
return exactLevel return exactLevel
} else { } else {
for (i = 0; i < xps.length; i++) { for (let i = 0; i < xps.length; i++) {
if (xp < xps[i]) { if (xp < xps[i]) {
exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1]) exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1])
return exactLevel return exactLevel