From 9faec905a7892339f542767b4aee8ec0b29208ce Mon Sep 17 00:00:00 2001 From: nathomp3 Date: Sun, 7 Aug 2022 01:44:08 -0400 Subject: [PATCH 1/3] updated old commands --- commands/categories.js | 10 +- commands/dream.js | 18 +- commands/help.js | 28 +- commands/hypixel.js | 16 +- commands/leaderboard.js | 40 +- commands/link.js | 6 +- commands/ping.js | 6 +- commands/search.js | 10 +- commands/unverified.js | 16 +- commands/verified.js | 10 +- index.js | 6 +- messagecommands/banlist.js | 8 +- messagecommands/dream.js | 18 +- messagecommands/runners.js | 24 +- package-lock.json | 656 ++++++++++++++---------------- package.json | 10 +- scheduledcommands/checkInvalid.js | 8 + scheduledcommands/combinedLB.js | 12 +- scheduledcommands/dailyLB.js | 56 ++- 19 files changed, 491 insertions(+), 467 deletions(-) diff --git a/commands/categories.js b/commands/categories.js index c297992..7eb1964 100644 --- a/commands/categories.js +++ b/commands/categories.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); @@ -26,8 +26,8 @@ module.exports = { return await interaction.editReply(`No results found for **${game}**.`); } const [dataArr] = data; - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle(dataArr.names.international) .setURL(dataArr.weblink) .setThumbnail(dataArr.assets["cover-large"].uri); @@ -55,7 +55,9 @@ module.exports = { if(size > 6000) { break; } - embed.addField(string, string2); + embed.addFields([ + { name: string, value: string2, } + ]); } return await interaction.editReply({ embeds: [embed] }); }, diff --git a/commands/dream.js b/commands/dream.js index c7f07b0..db07496 100644 --- a/commands/dream.js +++ b/commands/dream.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -59,14 +59,16 @@ module.exports = { const difference = pMax >= 42 ? "+" + pMax - 42 : pMax - 42; // Compares rods to Dream const difference2 = rMax >= 211 ? "+" + rMax - 211 : rMax - 211; - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Your Results:") - .addField("Number of simulations: ", String(sim)) - .addField("Average number of pearl trades: ", String(pTotal / sim)) - .addField("Average number of rods: ", String(rTotal / sim)) - .addField("Max number of pearl trades: " + pMax + "/262", "Number of pearl trades (Dream): 42/262") - .addField("Max number of rods: " + rMax + "/305", "Number of rods (Dream): 211/305") + .addFields([ + { name: "Number of simulations: ", value: String(sim) }, + { name: "Average number of pearl trades: ", value: String(pTotal / sim ) }, + { name: "Average number of rods: ", value: String(rTotal / sim ) }, + { name: "Max number of pearl trades: " + pMax + "/262", value: "Number of pearl trades (Dream) 42/262" }, + { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream }]) 211/305" } + ]) .setFooter({ text: "Difference: " + difference + "/" + difference2 }); await interaction.editReply({ embeds: [embed] }); }, diff --git a/commands/help.js b/commands/help.js index 6b1ec6e..04c7ba5 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -12,20 +12,22 @@ module.exports = { .setName("help") .setDescription("Provides a list of commands and descriptions."), async execute(interaction) { - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Help") .setThumbnail("https://www.speedrun.com/images/1st.png") - .addField("/help", "Shows this help message.") - .addField("/hypixel", "Provides helpful links for Hypixel Speedruns") - .addField("/link ", "Sends a link to the provided game.") - .addField("/categories ", "Shows the categories/variables for the provided game.") - .addField("/search (page)", "Searches for games containing the keyword(s).") - .addField("/leaderboard ", "Provides a leaderboard for the given game.") - .addField("/verified ", "Provides the number of runs verified by the given user.") - .addField("/queuelength ", "Provides the number of unverified runs for the given game.") - .addField("/dream (simulations)", "Simulates Dream's pearl and blaze rod odds.") - .addField("/ping", "Provides bot response time."); + .addFields([ + { name: "/help", value: "Shows this help message." }, + { name: "/hypixel", value: "Provides helpful links for Hypixel Speedruns" }, + { name: "/link ", value: "Sends a link to the provided game." }, + { name: "/categories ", value: "Shows the categories/variables for the provided game." }, + { name: "/search (page)", value: "Searches for games containing the keyword(s)." }, + { name: "/leaderboard ", value: "Provides a leaderboard for the given game." }, + { name: "/verified ", value: "Provides the number of runs verified by the given user." }, + { name: "/queuelength ", value: "Provides the number of unverified runs for the given game." }, + { name: "/dream (simulations)", value: "Simulates Dream's pearl and blaze rod odds." }, + { name: "/ping", value: "Provides bot response time." } + ]) await interaction.editReply("Sending you help!"); await interaction.followUp({ embeds: [embed], ephemeral: true }); }, diff --git a/commands/hypixel.js b/commands/hypixel.js index 57c3f83..7368000 100644 --- a/commands/hypixel.js +++ b/commands/hypixel.js @@ -1,4 +1,4 @@ -const { MessageActionRow, MessageSelectMenu, MessageButton } = require("discord.js"); +const { ActionRowBuilder, SelectMenuBuilder, ButtonBuilder, InteractionType } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -13,10 +13,10 @@ module.exports = { .setDescription("Provides helpful links for Hypixel Speedruns"), async execute(interaction) { // Initial running of the command - if(interaction.isCommand()) { - const row = new MessageActionRow() + if(interaction.type === InteractionType.ApplicationCommand) { + const row = new ActionRowBuilder() .addComponents( - new MessageSelectMenu() + new SelectMenuBuilder() .setCustomId("type") .setPlaceholder("Nothing selected") .addOptions([ @@ -171,9 +171,9 @@ module.exports = { ]; break; } - const row = new MessageActionRow() + const row = new ActionRowBuilder() .addComponents( - new MessageSelectMenu() + new SelectMenuBuilder() .setCustomId("link") .setPlaceholder("Nothing selected") .addOptions(options), @@ -256,9 +256,9 @@ module.exports = { url = "https://twitter.com/speedruncom"; break; } - const row = new MessageActionRow() + const row = new ActionRowBuilder() .addComponents( - new MessageButton() + new ButtonBuilder() .setLabel(interaction.values[0]) .setStyle("LINK") .setURL(url), diff --git a/commands/leaderboard.js b/commands/leaderboard.js index 459e041..d2a046d 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -1,5 +1,5 @@ const tokens = require("../index.js"); -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -140,13 +140,15 @@ module.exports = { } let date = new Date().toISOString().slice(0, 10); - let embed = new MessageEmbed() - .setColor("118855") + let embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) await interaction.editReply({ embeds: [embed] }); let playerList = []; // Iterates through each category @@ -231,13 +233,15 @@ module.exports = { } // Update embed if enough progress has been made if(Math.floor(progress/10) > lastEmbed) { - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) await interaction.editReply({ embeds: [embed] }); lastEmbed = Math.floor(progress/10); } @@ -325,13 +329,15 @@ module.exports = { } // Update embed if enough progress has been made if(Math.floor(progress2/10) > lastEmbed) { - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) await interaction.editReply({ embeds: [embed] }); lastEmbed = Math.floor(progress2/10); } @@ -347,13 +353,15 @@ module.exports = { let place = 1; let iterator = 0; let countPlayer = 0; - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }); for(const player of playerList) { - embed.addField("#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), `WRs:${player[1]}`, true); + embed.addFields([ + { name: "#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), value: `WRs:${player[1]}`, inline: true } + ]); countPlayer++; // Increment only if next WR count is not equal to this count if(playerList[iterator + 1] && playerList[iterator + 1][1] != playerList[iterator][1]) { diff --git a/commands/link.js b/commands/link.js index 214e34c..0d6e806 100644 --- a/commands/link.js +++ b/commands/link.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); @@ -27,8 +27,8 @@ module.exports = { return await interaction.editReply(`No results found for **${game}**.`); } // Embed to return - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle(answer.names.international) .setURL(answer.weblink) .setThumbnail(answer.assets["cover-large"].uri); diff --git a/commands/ping.js b/commands/ping.js index 6181036..5b3a610 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -12,8 +12,8 @@ module.exports = { .setName("ping") .setDescription("Provides bot response time."), async execute(interaction) { - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setThumbnail("https://www.speedrun.com/images/1st.png") .setTitle(`Ping: ${Date.now() - interaction.createdTimestamp}ms`); await interaction.editReply({ embeds: [embed] }); diff --git a/commands/search.js b/commands/search.js index 57102ea..05f05fc 100644 --- a/commands/search.js +++ b/commands/search.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); @@ -43,12 +43,14 @@ module.exports = { answer[i][0] = data[i].names.international; answer[i][1] = data[i].abbreviation + "\n" + data[i].weblink; } - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Results (Count: " + answer.length + ", Page: " + page + ")") .setThumbnail("https://www.speedrun.com/images/1st.png"); answer.forEach(entry => { - embed.addField(entry[0], entry[1]); + embed.addFields([ + {name: entry[0], value: entry[1] } + ]) }); if (answer.length == 20) { embed.setFooter({ text: "There may be more pages. Use /search " }); diff --git a/commands/unverified.js b/commands/unverified.js index 8f36074..e385e04 100644 --- a/commands/unverified.js +++ b/commands/unverified.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); @@ -33,15 +33,19 @@ module.exports = { data = await tokens.fetch(`https://www.speedrun.com/api/v1/runs?game=${id}&status=new&max=200&orderby=submitted&direction=asc&offset=${data.pagination.offset + 200}`); } const num = data.pagination.offset + data.pagination.size; - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Result for: " + game) .setThumbnail(gameData.data.assets["cover-large"].uri); if(firstPage) { - embed.addField("Number of unverified runs: ", String(num)) - .addField("Oldest unverified run: ", firstPage.submitted.substring(0,10)); + embed.addFields([ + { name: "Number of unverified runs: ", value: String(num) }, + { name: "Oldest unverified run: ", value: firstPage.submitted.substring(0,10) } + ]) } else { - embed.addField("Number of unverified runs: ", String(num)); + embed.addFields([ + {name: "Number of unverified runs: ", value: String(num) } + ]); } await interaction.editReply({ embeds: [embed] }); }, diff --git a/commands/verified.js b/commands/verified.js index 8ff9383..7ee3d53 100644 --- a/commands/verified.js +++ b/commands/verified.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); @@ -35,10 +35,12 @@ module.exports = { // Number of runs = the total offset + the current size const num = data.pagination.offset + data.pagination.size; // Creates embed - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Result for: " + user) - .addField("Number of runs verified: ", num >= 10000 ? ">= 10k" : String(num)) + .addFields([ + {name: "Number of runs verified: ", value: num >= 10000 ? ">= 10k" : String(num) } + ]) .setThumbnail(playerData.data.assets.image.uri); return await interaction.editReply({ embeds: [embed] }); }, diff --git a/index.js b/index.js index 378dd87..1b0536f 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ // Imports -const { Client, Intents, Collection } = require("discord.js"); +const { Client, GatewayIntentBits, Collection, InteractionType } = require("discord.js"); const fs = require("fs"); const Limit = require("./Limiter.js"); const Queue = require("queue-promise"); @@ -27,7 +27,7 @@ let mongourl = process.env.mongourl; let src = process.env.srcapi; // Creates new Client -const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] }); +const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] }); client.commands = new Collection(); client.msgCommands = new Collection(); @@ -93,7 +93,7 @@ client.on("messageCreate", async message => { }); client.on("interactionCreate", async interaction => { - if(interaction.isCommand()) { + if(interaction.type === InteractionType.ApplicationCommand) { if (!client.commands.has(interaction.commandName)) return; await interaction.deferReply(); try { diff --git a/messagecommands/banlist.js b/messagecommands/banlist.js index 1f6a4cb..88521c3 100644 --- a/messagecommands/banlist.js +++ b/messagecommands/banlist.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const token = require("../index.js"); /** @@ -118,11 +118,11 @@ async function search(id, message) { if(!result) { return await message.reply("Player is not in banlist"); } - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle(`Name: ${id}`) .addField("UUID", result.id) .addField("Added by", "<@" + result.owner + ">") - .addField("Date", result.time.substr(0, 10)); + ..addFields([{name: "Date", value: result.time.substr(0, 10 }]); return await message.reply({ embeds: [embed] }); } \ No newline at end of file diff --git a/messagecommands/dream.js b/messagecommands/dream.js index 1d33cfb..779ad9f 100644 --- a/messagecommands/dream.js +++ b/messagecommands/dream.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); /** * Function to provide a simulation of Dream's pearl/blaze rod odds. @@ -49,14 +49,16 @@ module.exports = { const difference = pMax >= 42 ? "+" + pMax - 42 : pMax - 42; // Compares rods to Dream const difference2 = rMax >= 211 ? "+" + rMax - 211 : rMax - 211; - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle("Your Results:") - .addField("Number of simulations: ", String(sim)) - .addField("Average number of pearl trades: ", String(pTotal / sim)) - .addField("Average number of rods: ", String(rTotal / sim)) - .addField("Max number of pearl trades: " + pMax + "/262", "Number of pearl trades (Dream): 42/262") - .addField("Max number of rods: " + rMax + "/305", "Number of rods (Dream): 211/305") + .addFields([ + { name: "Number of simulations: ", value: String(sim) }, + { name: "Average number of pearl trades: ", value: String(pTotal / sim ) }, + { name: "Average number of rods: ", value: String(rTotal / sim ) }, + { name: "Max number of pearl trades: " + pMax + "/262", value: "Number of pearl trades (Dream) 42/262" }, + { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream }]) 211/305" } + ]) .setFooter({ text: "Difference: " + difference + "/" + difference2 }); await message.reply({ embeds: [embed] }); }, diff --git a/messagecommands/runners.js b/messagecommands/runners.js index 8a94060..b0a4bde 100644 --- a/messagecommands/runners.js +++ b/messagecommands/runners.js @@ -1,4 +1,4 @@ -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); const token = require("../index.js"); /** @@ -142,14 +142,16 @@ async function search(id, message) { return await message.reply("Player is not in known runners"); } const src = await token.fetch(`https://www.speedrun.com/api/v1/users/${result.account}`); - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle(`Name: ${id}`) .setURL(`https://sk1er.club/s/${id}`) - .addField("Speedrun.com", src.data.weblink) - .addField("UUID", result.id) - .addField("Added by", "<@" + result.owner + ">") - .addField("Date", result.time.substr(0, 10)); + .addFields([ + { name: "Speedrun.com", value: src.data.weblink }, + { name: "UUID", value: result.id }, + { name: "Added by", value: "<@" + result.owner + ">" }, + { name: "Date", value: result.time.substr(0, 10) } + ]); return await message.reply({ embeds: [embed] }); } @@ -176,14 +178,16 @@ async function searchSRC(id, message) { } const accounts = await result.toArray(); await token.db.close(); - const embed = new MessageEmbed() - .setColor("118855") + const embed = new EmbedBuilder() + .setColor(118855) .setTitle(`Name: ${src.data.names.international}`) .setURL(src.data.weblink); for(const account of accounts) { // Gets player from mojang api const player = await token.fetchMojang(`https://api.mojang.com/user/profiles/${account.id}/names`); - embed.addField(`${player[player.length - 1].name}`, `[Stats](https://sk1er.club/s/${player[player.length - 1].name})`); + embed.addFields([ + { name: `${player[player.length - 1].name}`, value: `[Stats](https://sk1er.club/s/${player[player.length - 1].name})` } + ]); } return await message.reply({ embeds: [embed] }); } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4bd8000..49b86f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "2.0.0", "license": "ISC", "dependencies": { - "@discordjs/builders": "^0.15.0", - "@discordjs/rest": "^0.5.0", - "discord.js": "^13.8.1", + "@discordjs/builders": "^1.1.0", + "@discordjs/rest": "^1.0.1", + "discord.js": "^14.1.2", "dotenv": "^16.0.1", "mongodb": "^4.8.0", "node-cron": "^3.0.1", @@ -24,18 +24,17 @@ "eslint": "^8.21.0" }, "engines": { - "node": "16.6.1", - "npm": "7.20.3" + "node": "16.16.0", + "npm": "8.11.0" } }, "node_modules/@discordjs/builders": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.15.0.tgz", - "integrity": "sha512-w1UfCPzx2iKycn6qh/f0c+PcDpcTHzHr7TXALXu/a4gKHGamiSg3lP8GhYswweSJk/Q5cbFLHZUsnoY3MVKNAg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.1.0.tgz", + "integrity": "sha512-EO8TSltiIc9Z1wE854wAFvv5AccqEtvjFmao9PPoxQhRaJ0hEb7FwWRTCA1jGg4ZWI3hcp4m+RET5ufZQz3rOg==", "dependencies": { - "@sapphire/shapeshift": "^3.1.0", - "@sindresorhus/is": "^4.6.0", - "discord-api-types": "^0.33.3", + "@sapphire/shapeshift": "^3.5.1", + "discord-api-types": "^0.36.3", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" @@ -45,24 +44,25 @@ } }, "node_modules/@discordjs/collection": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", - "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz", + "integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw==", "engines": { "node": ">=16.9.0" } }, "node_modules/@discordjs/rest": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0.tgz", - "integrity": "sha512-S4E1YNz1UxgUfMPpMeqzPPkCfXE877zOsvKM5WEmwIhcpz1PQV7lzqlEOuz194UuwOJLLjQFBgQELnQfCX9UfA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz", + "integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==", "dependencies": { - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.3.1", + "@discordjs/collection": "^1.0.1", + "@sapphire/async-queue": "^1.3.2", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.33.3", + "discord-api-types": "^0.36.3", + "file-type": "^17.1.4", "tslib": "^2.4.0", - "undici": "^5.4.0" + "undici": "^5.8.0" }, "engines": { "node": ">=16.9.0" @@ -154,20 +154,24 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", - "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", + "integrity": "sha512-rUpMLATsoAMnlN3gecAcr9Ecnw1vG7zi5Xr+IX22YzRzi1k9PF9vKzoT8RuEJbiIszjcimu3rveqUnvwDopz8g==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" } }, "node_modules/@sapphire/shapeshift": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.1.0.tgz", - "integrity": "sha512-PkxFXd3QJ1qAPS05Dy2UkVGYPm/asF1Ugt2Xyzmv4DHzO3+G7l+873C4XFFcJ9M5Je+eCMC7SSifgPTSur5QuA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", + "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash.uniqwith": "^4.5.0" + }, "engines": { - "node": ">=v15.0.0", + "node": ">=v14.0.0", "npm": ">=7.0.0" } }, @@ -180,44 +184,16 @@ "npm": ">=7.0.0" } }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, "node_modules/@types/node": { "version": "16.4.13", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.13.tgz", "integrity": "sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg==" }, - "node_modules/@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/webidl-conversions": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz", @@ -301,11 +277,6 @@ "node": ">=8" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -466,17 +437,6 @@ "node": ">=8" } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -528,14 +488,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", @@ -557,84 +509,31 @@ } }, "node_modules/discord-api-types": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.3.tgz", - "integrity": "sha512-P3A1RJXKEDmGPHrFTN5+gYLsBPGUVGj+D3+fa3m0K/umc+LMfqGuEad+p7cNq7ry/icReVhS3bz9jvBvne/BRA==" + "version": "0.36.3", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", + "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "node_modules/discord.js": { - "version": "13.8.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.8.1.tgz", - "integrity": "sha512-jOsD+4tEZWWx0RHVyH+FBcqoTrsL+d5Mm5p+ULQOdU0qSaxhLNkWYig+yDHNZoND7nlkXX3qi+BW+gO5erWylg==", - "dependencies": { - "@discordjs/builders": "^0.14.0", - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.3.1", - "@types/node-fetch": "^2.6.1", - "@types/ws": "^8.5.3", - "discord-api-types": "^0.33.3", - "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.7.0" - }, - "engines": { - "node": ">=16.6.0", - "npm": ">=7.0.0" - } - }, - "node_modules/discord.js/node_modules/@discordjs/builders": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0.tgz", - "integrity": "sha512-+fqLIqa9wN3R+kvlld8sgG0nt04BAZxdCDP4t2qZ9TJsquLWA+xMtT8Waibb3d4li4AQS+IOfjiHAznv/dhHgQ==", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.1.2.tgz", + "integrity": "sha512-apdWNLkjAkeEnuNpB8H6rS/4OgrXQlSAjuuzeodjCOdIXy3OwOjD314V/HiSttcAlr9+r3ONhaT5qvbDad5SIg==", "dependencies": { - "@sapphire/shapeshift": "^3.1.0", - "@sindresorhus/is": "^4.6.0", - "discord-api-types": "^0.33.3", + "@discordjs/builders": "^1.1.0", + "@discordjs/collection": "^1.0.1", + "@discordjs/rest": "^1.0.1", + "@sapphire/snowflake": "^3.2.2", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.36.3", "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" + "lodash.snakecase": "^4.1.1", + "tslib": "^2.4.0", + "undici": "^5.8.0", + "ws": "^8.8.1" }, "engines": { "node": ">=16.9.0" } }, - "node_modules/discord.js/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/discord.js/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/discord.js/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/discord.js/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -919,6 +818,22 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/file-type": { + "version": "17.1.6", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", + "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", + "dependencies": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0-alpha.9", + "token-types": "^5.0.0-alpha.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -966,19 +881,6 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -1141,8 +1043,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ip": { "version": "1.1.5", @@ -1243,6 +1144,16 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" + }, + "node_modules/lodash.uniqwith": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", + "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" + }, "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -1271,25 +1182,6 @@ "node": ">=8.6" } }, - "node_modules/mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dependencies": { - "mime-db": "1.44.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1487,6 +1379,18 @@ "node": ">=8" } }, + "node_modules/peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/perf_hooks": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/perf_hooks/-/perf_hooks-0.0.1.tgz", @@ -1549,6 +1453,34 @@ "node": ">=8.12.0" } }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "dependencies": { + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -1618,6 +1550,25 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/saslprep": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", @@ -1691,6 +1642,14 @@ "memory-pager": "^1.0.2" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1715,6 +1674,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strtok3": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^5.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -1733,6 +1708,22 @@ "node": ">=8.0" } }, + "node_modules/token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -1795,6 +1786,11 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -1868,9 +1864,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.7.0.tgz", - "integrity": "sha512-c2gsP0PRwcLFzUiA8Mkr37/MI7ilIlHQxaEAtd0uNMbVMoy8puJyafRlm0bV9MbGSabUPeLrRRaqIBcFcA2Pqg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", + "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", "engines": { "node": ">=10.0.0" }, @@ -1902,34 +1898,34 @@ }, "dependencies": { "@discordjs/builders": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.15.0.tgz", - "integrity": "sha512-w1UfCPzx2iKycn6qh/f0c+PcDpcTHzHr7TXALXu/a4gKHGamiSg3lP8GhYswweSJk/Q5cbFLHZUsnoY3MVKNAg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.1.0.tgz", + "integrity": "sha512-EO8TSltiIc9Z1wE854wAFvv5AccqEtvjFmao9PPoxQhRaJ0hEb7FwWRTCA1jGg4ZWI3hcp4m+RET5ufZQz3rOg==", "requires": { - "@sapphire/shapeshift": "^3.1.0", - "@sindresorhus/is": "^4.6.0", - "discord-api-types": "^0.33.3", + "@sapphire/shapeshift": "^3.5.1", + "discord-api-types": "^0.36.3", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.1", "tslib": "^2.4.0" } }, "@discordjs/collection": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", - "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.0.1.tgz", + "integrity": "sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw==" }, "@discordjs/rest": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0.tgz", - "integrity": "sha512-S4E1YNz1UxgUfMPpMeqzPPkCfXE877zOsvKM5WEmwIhcpz1PQV7lzqlEOuz194UuwOJLLjQFBgQELnQfCX9UfA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-1.0.1.tgz", + "integrity": "sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg==", "requires": { - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.3.1", + "@discordjs/collection": "^1.0.1", + "@sapphire/async-queue": "^1.3.2", "@sapphire/snowflake": "^3.2.2", - "discord-api-types": "^0.33.3", + "discord-api-types": "^0.36.3", + "file-type": "^17.1.4", "tslib": "^2.4.0", - "undici": "^5.4.0" + "undici": "^5.8.0" } }, "@eslint/eslintrc": { @@ -1999,51 +1995,34 @@ } }, "@sapphire/async-queue": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", - "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.2.tgz", + "integrity": "sha512-rUpMLATsoAMnlN3gecAcr9Ecnw1vG7zi5Xr+IX22YzRzi1k9PF9vKzoT8RuEJbiIszjcimu3rveqUnvwDopz8g==" }, "@sapphire/shapeshift": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.1.0.tgz", - "integrity": "sha512-PkxFXd3QJ1qAPS05Dy2UkVGYPm/asF1Ugt2Xyzmv4DHzO3+G7l+873C4XFFcJ9M5Je+eCMC7SSifgPTSur5QuA==" + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz", + "integrity": "sha512-7JFsW5IglyOIUQI1eE0g6h06D/Far6HqpcowRScgCiLSqTf3hhkPWCWotVTtVycnDCMYIwPeaw6IEPBomKC8pA==", + "requires": { + "fast-deep-equal": "^3.1.3", + "lodash.uniqwith": "^4.5.0" + } }, "@sapphire/snowflake": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" }, - "@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" + "@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, "@types/node": { "version": "16.4.13", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.13.tgz", "integrity": "sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg==" }, - "@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "@types/webidl-conversions": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz", @@ -2109,11 +2088,6 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2218,14 +2192,6 @@ } } }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2263,11 +2229,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, "denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", @@ -2283,66 +2244,26 @@ } }, "discord-api-types": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.3.tgz", - "integrity": "sha512-P3A1RJXKEDmGPHrFTN5+gYLsBPGUVGj+D3+fa3m0K/umc+LMfqGuEad+p7cNq7ry/icReVhS3bz9jvBvne/BRA==" + "version": "0.36.3", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", + "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" }, "discord.js": { - "version": "13.8.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.8.1.tgz", - "integrity": "sha512-jOsD+4tEZWWx0RHVyH+FBcqoTrsL+d5Mm5p+ULQOdU0qSaxhLNkWYig+yDHNZoND7nlkXX3qi+BW+gO5erWylg==", - "requires": { - "@discordjs/builders": "^0.14.0", - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.3.1", - "@types/node-fetch": "^2.6.1", + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.1.2.tgz", + "integrity": "sha512-apdWNLkjAkeEnuNpB8H6rS/4OgrXQlSAjuuzeodjCOdIXy3OwOjD314V/HiSttcAlr9+r3ONhaT5qvbDad5SIg==", + "requires": { + "@discordjs/builders": "^1.1.0", + "@discordjs/collection": "^1.0.1", + "@discordjs/rest": "^1.0.1", + "@sapphire/snowflake": "^3.2.2", "@types/ws": "^8.5.3", - "discord-api-types": "^0.33.3", - "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.7.0" - }, - "dependencies": { - "@discordjs/builders": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0.tgz", - "integrity": "sha512-+fqLIqa9wN3R+kvlld8sgG0nt04BAZxdCDP4t2qZ9TJsquLWA+xMtT8Waibb3d4li4AQS+IOfjiHAznv/dhHgQ==", - "requires": { - "@sapphire/shapeshift": "^3.1.0", - "@sindresorhus/is": "^4.6.0", - "discord-api-types": "^0.33.3", - "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" - } - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } + "discord-api-types": "^0.36.3", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.4.0", + "undici": "^5.8.0", + "ws": "^8.8.1" } }, "doctrine": { @@ -2554,6 +2475,16 @@ "flat-cache": "^3.0.4" } }, + "file-type": { + "version": "17.1.6", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-17.1.6.tgz", + "integrity": "sha512-hlDw5Ev+9e883s0pwUsuuYNu4tD7GgpUnOvykjv1Gya0ZIjuKumthDRua90VUn6/nlRKAjcxLUnHNTIUWwWIiw==", + "requires": { + "readable-web-to-node-stream": "^3.0.2", + "strtok3": "^7.0.0-alpha.9", + "token-types": "^5.0.0-alpha.2" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2589,16 +2520,6 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, "formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -2711,8 +2632,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ip": { "version": "1.1.5", @@ -2792,6 +2712,16 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" + }, + "lodash.uniqwith": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", + "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==" + }, "memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -2814,19 +2744,6 @@ "picomatch": "^2.3.1" } }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "requires": { - "mime-db": "1.44.0" - } - }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2963,6 +2880,11 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "peek-readable": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz", + "integrity": "sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==" + }, "perf_hooks": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/perf_hooks/-/perf_hooks-0.0.1.tgz", @@ -2996,6 +2918,24 @@ "resolved": "https://registry.npmjs.org/queue-promise/-/queue-promise-2.2.1.tgz", "integrity": "sha512-C3eyRwLF9m6dPV4MtqMVFX+Xmc7keZ9Ievm3jJ/wWM5t3uVbFnGsJXwpYzZ4LaIEcX9bss/mdaKzyrO6xheRuA==" }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readable-web-to-node-stream": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz", + "integrity": "sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==", + "requires": { + "readable-stream": "^3.6.0" + } + }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -3032,6 +2972,11 @@ "queue-microtask": "^1.2.2" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "saslprep": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", @@ -3085,6 +3030,14 @@ "memory-pager": "^1.0.2" } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -3100,6 +3053,15 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strtok3": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-7.0.0.tgz", + "integrity": "sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==", + "requires": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^5.0.0" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3115,6 +3077,15 @@ "is-number": "^7.0.0" } }, + "token-types": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-5.0.1.tgz", + "integrity": "sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==", + "requires": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + } + }, "tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -3162,6 +3133,11 @@ "punycode": "^2.1.0" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -3214,9 +3190,9 @@ "dev": true }, "ws": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.7.0.tgz", - "integrity": "sha512-c2gsP0PRwcLFzUiA8Mkr37/MI7ilIlHQxaEAtd0uNMbVMoy8puJyafRlm0bV9MbGSabUPeLrRRaqIBcFcA2Pqg==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", + "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", "requires": {} }, "yocto-queue": { diff --git a/package.json b/package.json index 2445f26..f05dfb9 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "author": "penguin", "license": "ISC", "dependencies": { - "@discordjs/builders": "^0.15.0", - "@discordjs/rest": "^0.5.0", - "discord.js": "^13.8.1", + "@discordjs/builders": "^1.1.0", + "@discordjs/rest": "^1.0.1", + "discord.js": "^14.1.2", "dotenv": "^16.0.1", "mongodb": "^4.8.0", "node-cron": "^3.0.1", @@ -22,8 +22,8 @@ "uuid": "^8.3.2" }, "engines": { - "node": "16.6.1", - "npm": "7.20.3" + "node": "16.16.0", + "npm": "8.11.0" }, "devDependencies": { "eslint": "^8.21.0" diff --git a/scheduledcommands/checkInvalid.js b/scheduledcommands/checkInvalid.js index 547bcba..03f4d76 100644 --- a/scheduledcommands/checkInvalid.js +++ b/scheduledcommands/checkInvalid.js @@ -1,4 +1,5 @@ const tokens = require("../index.js"); +const { EmbedBuilder } = require('@discordjs/builders'); /** * Modified version of leaderboard.js to perform daily leaderboard updates and combine data @@ -8,6 +9,7 @@ module.exports = { interval: "0 */5 * * * *" }, async execute(client) { + const channel = await client.channels.cache.get("795130255324348456"); let data = await tokens.fetch(`https://www.speedrun.com/api/v1/runs?status=new&category=zd3q41ek&max=${Math.floor(Math.random() * 10 + 10)}`); for(const run of data.data) { const status = { @@ -21,6 +23,12 @@ module.exports = { body: JSON.stringify(status), headers: {"Content-Type": "application/json", "X-API-Key": tokens.src} }); + let date = new Date().toISOString().slice(0, 10); + let embed = new EmbedBuilder() + .setColor(118855) + .setTitle("Automatically rejected run: " + run.weblink) + .setFooter({ text: date }); + await channel.send({ embeds: [embed] }); } }, }; diff --git a/scheduledcommands/combinedLB.js b/scheduledcommands/combinedLB.js index a4403fe..7240040 100644 --- a/scheduledcommands/combinedLB.js +++ b/scheduledcommands/combinedLB.js @@ -62,8 +62,8 @@ async function findPlayers(category, mode) { async function updateRuns(category) { const channel = await client.channels.cache.get("795130255324348456"); let date = new Date().toISOString().slice(0, 10); - let embed = new MessageEmbed() - .setColor("118855") + let embed = new EmbedBuilder() + .setColor(118855) .setTitle("Generating combined leaderboard for " + players.length + " players") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); @@ -78,8 +78,8 @@ async function updateRuns(category) { Object.prototype.hasOwnProperty.call(player, "4v4"); }); - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Found " + players.length + " players with runs in all categories") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); @@ -126,8 +126,8 @@ async function updateRuns(category) { }); weblinks.push(submittedRun.weblink); } - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle(weblinks.length + " runs found to update/create.") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); diff --git a/scheduledcommands/dailyLB.js b/scheduledcommands/dailyLB.js index 340eb57..a15da81 100644 --- a/scheduledcommands/dailyLB.js +++ b/scheduledcommands/dailyLB.js @@ -1,5 +1,5 @@ const tokens = require("../index.js"); -const { MessageEmbed } = require("discord.js"); +const { EmbedBuilder } = require("discord.js"); /** * Modified version of leaderboard.js to perform daily leaderboard updates and combine data @@ -65,16 +65,18 @@ async function runDaily(games, channel) { await sleep(60000); } let date = new Date().toISOString().slice(0, 10); - let embed = new MessageEmbed() - .setColor("118855") + let embed = new EmbedBuilder() + .setColor(118855) .setTitle("Top Players for Group:") .setFooter({ text: date }); for(let player of topPlayers) { - embed.addField(player.replace(/[\\*_~]/g, "\\$&"), "\u200b", true); + embed.addFields([ + {name: player.replace(/[\\*_~]/g, "\\$&"), value: "\u200b", inline: true } + ]); } await channel.send({ embeds: [embed] }); - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Top WRs for Group:") .setFooter({ text: date }); totalScores.sort(function(a, b) { @@ -84,7 +86,9 @@ async function runDaily(games, channel) { let iterator = 0; let countPlayer = 0; for(let player of totalScores) { - embed.addField("#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), `WRs:${player[1]}`, true); + embed.addFields([ + { name: "#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), value: `WRs:${player[1]}`, inline: true } + ]); countPlayer++; if(totalScores[iterator + 1] && totalScores[iterator + 1][1] != totalScores[iterator][1]) { place++; @@ -186,13 +190,15 @@ async function generateBoard(game, channel) { } let date = new Date().toISOString().slice(0, 10); - let embed = new MessageEmbed() - .setColor("118855") + let embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) let message = await channel.send({ embeds: [embed] }); let playerList = []; // Iterates through each category @@ -277,13 +283,15 @@ async function generateBoard(game, channel) { } // Update embed if enough progress has been made if(Math.floor(progress/10) > lastEmbed) { - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) await message.edit({ embeds: [embed] }); lastEmbed = Math.floor(progress/10); } @@ -371,13 +379,15 @@ async function generateBoard(game, channel) { } // Update embed if enough progress has been made if(Math.floor(progress2/10) > lastEmbed) { - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) - .addField("Full Game Progress:", `${progress}/${count}`) - .addField("Individual Levels Progress:", `${progress2}/${count2}`); + .addFields([ + { name: "Full Game Progress:", value: `${progress}/${count}` }, + { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } + ]) await message.edit({ embeds: [embed] }); lastEmbed = Math.floor(progress2/10); } @@ -393,13 +403,15 @@ async function generateBoard(game, channel) { let place = 1; let iterator = 0; let countPlayer = 0; - embed = new MessageEmbed() - .setColor("118855") + embed = new EmbedBuilder() + .setColor(118855) .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }); for(const player of playerList) { - embed.addField("#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), `WRs:${player[1]}`, true); + embed.addFields([ + { name: "#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), value: `WRs:${player[1]}`, inline: true } + ]); countPlayer++; // Increment only if next WR count is not equal to this count if(playerList[iterator + 1] && playerList[iterator + 1][1] != playerList[iterator][1]) { From 422464bfe4c27c4f8c2f3735de03ce6160f456eb Mon Sep 17 00:00:00 2001 From: nathomp3 Date: Sun, 7 Aug 2022 13:21:14 -0400 Subject: [PATCH 2/3] remaining changes --- commands/categories.js | 4 ++-- commands/dream.js | 4 ++-- commands/help.js | 2 +- commands/hypixel.js | 4 ++-- commands/leaderboard.js | 20 +++++++------------- commands/link.js | 2 +- commands/ping.js | 2 +- commands/search.js | 2 +- commands/unverified.js | 2 +- commands/verified.js | 2 +- index.js | 2 +- messagecommands/banlist.js | 10 ++++++---- messagecommands/dream.js | 4 ++-- messagecommands/runners.js | 4 ++-- scheduledcommands/checkInvalid.js | 2 +- scheduledcommands/combinedLB.js | 6 +++--- scheduledcommands/dailyLB.js | 24 +++++++++--------------- 17 files changed, 43 insertions(+), 53 deletions(-) diff --git a/commands/categories.js b/commands/categories.js index 7eb1964..6438ffa 100644 --- a/commands/categories.js +++ b/commands/categories.js @@ -27,13 +27,13 @@ module.exports = { } const [dataArr] = data; const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(dataArr.names.international) .setURL(dataArr.weblink) .setThumbnail(dataArr.assets["cover-large"].uri); // Iterates through all the categories for the game let size = 0; - for (const category of dataArr.categories.data) { + for (const category of dataArr.categories.data.slice(0, 25)) { let variables = ""; // Checks if variables exist if (category.variables.data[0]) { diff --git a/commands/dream.js b/commands/dream.js index db07496..a250a7e 100644 --- a/commands/dream.js +++ b/commands/dream.js @@ -60,14 +60,14 @@ module.exports = { // Compares rods to Dream const difference2 = rMax >= 211 ? "+" + rMax - 211 : rMax - 211; const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Your Results:") .addFields([ { name: "Number of simulations: ", value: String(sim) }, { name: "Average number of pearl trades: ", value: String(pTotal / sim ) }, { name: "Average number of rods: ", value: String(rTotal / sim ) }, { name: "Max number of pearl trades: " + pMax + "/262", value: "Number of pearl trades (Dream) 42/262" }, - { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream }]) 211/305" } + { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream) 211/305" } ]) .setFooter({ text: "Difference: " + difference + "/" + difference2 }); await interaction.editReply({ embeds: [embed] }); diff --git a/commands/help.js b/commands/help.js index 04c7ba5..8c82933 100644 --- a/commands/help.js +++ b/commands/help.js @@ -13,7 +13,7 @@ module.exports = { .setDescription("Provides a list of commands and descriptions."), async execute(interaction) { const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Help") .setThumbnail("https://www.speedrun.com/images/1st.png") .addFields([ diff --git a/commands/hypixel.js b/commands/hypixel.js index 7368000..29e35cb 100644 --- a/commands/hypixel.js +++ b/commands/hypixel.js @@ -1,4 +1,4 @@ -const { ActionRowBuilder, SelectMenuBuilder, ButtonBuilder, InteractionType } = require("discord.js"); +const { ActionRowBuilder, SelectMenuBuilder, ButtonBuilder, InteractionType, ButtonStyle } = require("discord.js"); const { SlashCommandBuilder } = require("@discordjs/builders"); /** @@ -260,7 +260,7 @@ module.exports = { .addComponents( new ButtonBuilder() .setLabel(interaction.values[0]) - .setStyle("LINK") + .setStyle(ButtonStyle.Link) .setURL(url), ); await interaction.update({ content: interaction.values[0] + " Link:", components: [row] }); diff --git a/commands/leaderboard.js b/commands/leaderboard.js index d2a046d..951651a 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -141,7 +141,7 @@ module.exports = { let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -234,7 +234,7 @@ module.exports = { // Update embed if enough progress has been made if(Math.floor(progress/10) > lastEmbed) { embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -330,7 +330,7 @@ module.exports = { // Update embed if enough progress has been made if(Math.floor(progress2/10) > lastEmbed) { embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -351,26 +351,20 @@ module.exports = { playerList = playerList.filter(word => word[0].toLowerCase() !== "n/a"); // Which place to display let place = 1; - let iterator = 0; - let countPlayer = 0; embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }); - for(const player of playerList) { + for(let i = 0; i < 25; i++) { + const player = playerList[i]; embed.addFields([ { name: "#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), value: `WRs:${player[1]}`, inline: true } ]); - countPlayer++; // Increment only if next WR count is not equal to this count - if(playerList[iterator + 1] && playerList[iterator + 1][1] != playerList[iterator][1]) { + if(playerList[i + 1] && playerList[i + 1][1] != playerList[i][1]) { place++; } - if(countPlayer > 30) { - break; - } - iterator++; } await interaction.editReply({ embeds: [embed] }); }, diff --git a/commands/link.js b/commands/link.js index 0d6e806..6cb22b4 100644 --- a/commands/link.js +++ b/commands/link.js @@ -28,7 +28,7 @@ module.exports = { } // Embed to return const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(answer.names.international) .setURL(answer.weblink) .setThumbnail(answer.assets["cover-large"].uri); diff --git a/commands/ping.js b/commands/ping.js index 5b3a610..b78c687 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -13,7 +13,7 @@ module.exports = { .setDescription("Provides bot response time."), async execute(interaction) { const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setThumbnail("https://www.speedrun.com/images/1st.png") .setTitle(`Ping: ${Date.now() - interaction.createdTimestamp}ms`); await interaction.editReply({ embeds: [embed] }); diff --git a/commands/search.js b/commands/search.js index 05f05fc..860c026 100644 --- a/commands/search.js +++ b/commands/search.js @@ -44,7 +44,7 @@ module.exports = { answer[i][1] = data[i].abbreviation + "\n" + data[i].weblink; } const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Results (Count: " + answer.length + ", Page: " + page + ")") .setThumbnail("https://www.speedrun.com/images/1st.png"); answer.forEach(entry => { diff --git a/commands/unverified.js b/commands/unverified.js index e385e04..b338c95 100644 --- a/commands/unverified.js +++ b/commands/unverified.js @@ -34,7 +34,7 @@ module.exports = { } const num = data.pagination.offset + data.pagination.size; const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Result for: " + game) .setThumbnail(gameData.data.assets["cover-large"].uri); if(firstPage) { diff --git a/commands/verified.js b/commands/verified.js index 7ee3d53..a2648c7 100644 --- a/commands/verified.js +++ b/commands/verified.js @@ -36,7 +36,7 @@ module.exports = { const num = data.pagination.offset + data.pagination.size; // Creates embed const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Result for: " + user) .addFields([ {name: "Number of runs verified: ", value: num >= 10000 ? ">= 10k" : String(num) } diff --git a/index.js b/index.js index 1b0536f..e57a39e 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ let mongourl = process.env.mongourl; let src = process.env.srcapi; // Creates new Client -const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] }); +const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] }); client.commands = new Collection(); client.msgCommands = new Collection(); diff --git a/messagecommands/banlist.js b/messagecommands/banlist.js index 88521c3..6cdc72a 100644 --- a/messagecommands/banlist.js +++ b/messagecommands/banlist.js @@ -119,10 +119,12 @@ async function search(id, message) { return await message.reply("Player is not in banlist"); } const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(`Name: ${id}`) - .addField("UUID", result.id) - .addField("Added by", "<@" + result.owner + ">") - ..addFields([{name: "Date", value: result.time.substr(0, 10 }]); + .addFields([ + { name: "UUID", value: result.id }, + { name: "Added by", value: "<@" + result.owner + ">" }, + { name: "Date", value: result.time.substr(0, 10) } + ]); return await message.reply({ embeds: [embed] }); } \ No newline at end of file diff --git a/messagecommands/dream.js b/messagecommands/dream.js index 779ad9f..cee918e 100644 --- a/messagecommands/dream.js +++ b/messagecommands/dream.js @@ -50,14 +50,14 @@ module.exports = { // Compares rods to Dream const difference2 = rMax >= 211 ? "+" + rMax - 211 : rMax - 211; const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Your Results:") .addFields([ { name: "Number of simulations: ", value: String(sim) }, { name: "Average number of pearl trades: ", value: String(pTotal / sim ) }, { name: "Average number of rods: ", value: String(rTotal / sim ) }, { name: "Max number of pearl trades: " + pMax + "/262", value: "Number of pearl trades (Dream) 42/262" }, - { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream }]) 211/305" } + { name: "Max number of rods: " + rMax + "/305", value: "Number of rods (Dream) 211/305" } ]) .setFooter({ text: "Difference: " + difference + "/" + difference2 }); await message.reply({ embeds: [embed] }); diff --git a/messagecommands/runners.js b/messagecommands/runners.js index b0a4bde..e32c03b 100644 --- a/messagecommands/runners.js +++ b/messagecommands/runners.js @@ -143,7 +143,7 @@ async function search(id, message) { } const src = await token.fetch(`https://www.speedrun.com/api/v1/users/${result.account}`); const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(`Name: ${id}`) .setURL(`https://sk1er.club/s/${id}`) .addFields([ @@ -179,7 +179,7 @@ async function searchSRC(id, message) { const accounts = await result.toArray(); await token.db.close(); const embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(`Name: ${src.data.names.international}`) .setURL(src.data.weblink); for(const account of accounts) { diff --git a/scheduledcommands/checkInvalid.js b/scheduledcommands/checkInvalid.js index 03f4d76..207abf8 100644 --- a/scheduledcommands/checkInvalid.js +++ b/scheduledcommands/checkInvalid.js @@ -25,7 +25,7 @@ module.exports = { }); let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Automatically rejected run: " + run.weblink) .setFooter({ text: date }); await channel.send({ embeds: [embed] }); diff --git a/scheduledcommands/combinedLB.js b/scheduledcommands/combinedLB.js index 7240040..22865e5 100644 --- a/scheduledcommands/combinedLB.js +++ b/scheduledcommands/combinedLB.js @@ -63,7 +63,7 @@ async function updateRuns(category) { const channel = await client.channels.cache.get("795130255324348456"); let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Generating combined leaderboard for " + players.length + " players") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); @@ -79,7 +79,7 @@ async function updateRuns(category) { }); embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Found " + players.length + " players with runs in all categories") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); @@ -127,7 +127,7 @@ async function updateRuns(category) { weblinks.push(submittedRun.weblink); } embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle(weblinks.length + " runs found to update/create.") .setFooter({ text: date }); await channel.send({ embeds: [embed] }); diff --git a/scheduledcommands/dailyLB.js b/scheduledcommands/dailyLB.js index a15da81..c0cabf6 100644 --- a/scheduledcommands/dailyLB.js +++ b/scheduledcommands/dailyLB.js @@ -66,7 +66,7 @@ async function runDaily(games, channel) { } let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Top Players for Group:") .setFooter({ text: date }); for(let player of topPlayers) { @@ -76,7 +76,7 @@ async function runDaily(games, channel) { } await channel.send({ embeds: [embed] }); embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Top WRs for Group:") .setFooter({ text: date }); totalScores.sort(function(a, b) { @@ -191,7 +191,7 @@ async function generateBoard(game, channel) { let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -284,7 +284,7 @@ async function generateBoard(game, channel) { // Update embed if enough progress has been made if(Math.floor(progress/10) > lastEmbed) { embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -380,7 +380,7 @@ async function generateBoard(game, channel) { // Update embed if enough progress has been made if(Math.floor(progress2/10) > lastEmbed) { embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }) @@ -401,26 +401,20 @@ async function generateBoard(game, channel) { playerList = playerList.filter(word => word[0].toLowerCase() !== "n/a"); // Which place to display let place = 1; - let iterator = 0; - let countPlayer = 0; embed = new EmbedBuilder() - .setColor(118855) + .setColor("#118855") .setTitle("Leaderboard for " + game + ":") .setThumbnail(data.assets["cover-large"].uri) .setFooter({ text: date }); - for(const player of playerList) { + for(let i = 0; i < 25; i++) { + const player = playerList[i]; embed.addFields([ { name: "#" + place + " " + player[0].replace(/[\\*_~]/g, "\\$&"), value: `WRs:${player[1]}`, inline: true } ]); - countPlayer++; // Increment only if next WR count is not equal to this count - if(playerList[iterator + 1] && playerList[iterator + 1][1] != playerList[iterator][1]) { + if(playerList[i + 1] && playerList[i + 1][1] != playerList[i][1]) { place++; } - if(countPlayer > 30) { - break; - } - iterator++; } await message.edit({ embeds: [embed] }); return playerList; From 1f35ee9390dbc3cbf373c06068c5e2ad48ca5a38 Mon Sep 17 00:00:00 2001 From: nathomp3 Date: Sun, 7 Aug 2022 13:35:14 -0400 Subject: [PATCH 3/3] linted code --- commands/help.js | 2 +- commands/leaderboard.js | 14 +++++++------- commands/search.js | 2 +- commands/unverified.js | 4 ++-- scheduledcommands/checkInvalid.js | 2 +- scheduledcommands/combinedLB.js | 9 +++++---- scheduledcommands/dailyLB.js | 6 +++--- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/commands/help.js b/commands/help.js index 8c82933..8134d26 100644 --- a/commands/help.js +++ b/commands/help.js @@ -27,7 +27,7 @@ module.exports = { { name: "/queuelength ", value: "Provides the number of unverified runs for the given game." }, { name: "/dream (simulations)", value: "Simulates Dream's pearl and blaze rod odds." }, { name: "/ping", value: "Provides bot response time." } - ]) + ]); await interaction.editReply("Sending you help!"); await interaction.followUp({ embeds: [embed], ephemeral: true }); }, diff --git a/commands/leaderboard.js b/commands/leaderboard.js index 951651a..31144ef 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -19,15 +19,15 @@ module.exports = { ) .addBooleanOption(option => option.setName("misc") - .setDescription("Include misc categories? Default: true") + .setDescription("Include misc categories? Default: true") ) .addBooleanOption(option => option.setName("fullgame") - .setDescription("Include Full Game Categories? Default: true") + .setDescription("Include Full Game Categories? Default: true") ) .addBooleanOption(option => option.setName("ils") - .setDescription("Include Individual Levels? Default: true") + .setDescription("Include Individual Levels? Default: true") ), async execute(interaction) { // From rsp via https://stackoverflow.com/questions/12303989/cartesian-product-of-multiple-arrays-in-javascript @@ -135,7 +135,7 @@ module.exports = { } } - if(!game.startsWith('hypixel_') && count + count2 > 500) { + if(!game.startsWith("hypixel_") && count + count2 > 500) { return await interaction.editReply(`Game ${game} has too many categories. Number of categories: ${count + count2}.`); } @@ -148,7 +148,7 @@ module.exports = { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); await interaction.editReply({ embeds: [embed] }); let playerList = []; // Iterates through each category @@ -241,7 +241,7 @@ module.exports = { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); await interaction.editReply({ embeds: [embed] }); lastEmbed = Math.floor(progress/10); } @@ -337,7 +337,7 @@ module.exports = { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); await interaction.editReply({ embeds: [embed] }); lastEmbed = Math.floor(progress2/10); } diff --git a/commands/search.js b/commands/search.js index 860c026..f763a5b 100644 --- a/commands/search.js +++ b/commands/search.js @@ -50,7 +50,7 @@ module.exports = { answer.forEach(entry => { embed.addFields([ {name: entry[0], value: entry[1] } - ]) + ]); }); if (answer.length == 20) { embed.setFooter({ text: "There may be more pages. Use /search " }); diff --git a/commands/unverified.js b/commands/unverified.js index b338c95..c4ecd28 100644 --- a/commands/unverified.js +++ b/commands/unverified.js @@ -41,11 +41,11 @@ module.exports = { embed.addFields([ { name: "Number of unverified runs: ", value: String(num) }, { name: "Oldest unverified run: ", value: firstPage.submitted.substring(0,10) } - ]) + ]); } else { embed.addFields([ {name: "Number of unverified runs: ", value: String(num) } - ]); + ]); } await interaction.editReply({ embeds: [embed] }); }, diff --git a/scheduledcommands/checkInvalid.js b/scheduledcommands/checkInvalid.js index 207abf8..39b9995 100644 --- a/scheduledcommands/checkInvalid.js +++ b/scheduledcommands/checkInvalid.js @@ -1,5 +1,5 @@ +const { EmbedBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); -const { EmbedBuilder } = require('@discordjs/builders'); /** * Modified version of leaderboard.js to perform daily leaderboard updates and combine data diff --git a/scheduledcommands/combinedLB.js b/scheduledcommands/combinedLB.js index 22865e5..77e9033 100644 --- a/scheduledcommands/combinedLB.js +++ b/scheduledcommands/combinedLB.js @@ -1,3 +1,4 @@ +const { EmbedBuilder } = require("@discordjs/builders"); const tokens = require("../index.js"); /** @@ -13,7 +14,7 @@ module.exports = { await findPlayers("wdmlzyxk", "3v3v3v3"); await findPlayers("vdom0912", "4v4v4v4"); await findPlayers("wkpm70jk", "4v4"); - await updateRuns("zd3q41ek"); + await updateRuns("zd3q41ek", client); }, }; @@ -59,7 +60,7 @@ async function findPlayers(category, mode) { } } -async function updateRuns(category) { +async function updateRuns(category, client) { const channel = await client.channels.cache.get("795130255324348456"); let date = new Date().toISOString().slice(0, 10); let embed = new EmbedBuilder() @@ -119,7 +120,7 @@ async function updateRuns(category) { } }; // Submits the run - await tokens.post("https://www.speedrun.com/api/v1/runs", { + const submittedRun = await tokens.post("https://www.speedrun.com/api/v1/runs", { method: "post", body: JSON.stringify(run), headers: {"Content-Type": "application/json", "X-API-Key": tokens.src} @@ -133,6 +134,6 @@ async function updateRuns(category) { await channel.send({ embeds: [embed] }); for(let i = 0; i < weblinks.length; i += 20) { - await channel.send('```\n' + weblinks.slice(i, i + 20).join('\n') + '```'); + await channel.send("```\n" + weblinks.slice(i, i + 20).join("\n") + "```"); } } \ No newline at end of file diff --git a/scheduledcommands/dailyLB.js b/scheduledcommands/dailyLB.js index c0cabf6..093256f 100644 --- a/scheduledcommands/dailyLB.js +++ b/scheduledcommands/dailyLB.js @@ -198,7 +198,7 @@ async function generateBoard(game, channel) { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); let message = await channel.send({ embeds: [embed] }); let playerList = []; // Iterates through each category @@ -291,7 +291,7 @@ async function generateBoard(game, channel) { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); await message.edit({ embeds: [embed] }); lastEmbed = Math.floor(progress/10); } @@ -387,7 +387,7 @@ async function generateBoard(game, channel) { .addFields([ { name: "Full Game Progress:", value: `${progress}/${count}` }, { name: "Individual Levels Progress:", value: `${progress2}/${count2}` } - ]) + ]); await message.edit({ embeds: [embed] }); lastEmbed = Math.floor(progress2/10); }