diff --git a/discord.json b/discord.json index b178fe184..70361c422 100644 --- a/discord.json +++ b/discord.json @@ -3,6 +3,7 @@ "client_id_dev": "1099063696015229078", "guild_id": "894784231677513819", "verify_channel": "909968131873726545", + "log_channel": "909185457533882428", "verify_role": "909968395154358333", "peasant_role": "896878529512370228" } diff --git a/package.json b/package.json index 0446f638f..2ace24497 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "type": "module", "scripts": { - "start": "ts-node-esm src/index.ts" + "start": "vite-node src/index.ts --script" }, "license": "MIT", "dependencies": { @@ -13,6 +13,7 @@ "discord.js": "^14.9.0", "node-fetch": "^3.3.1", "ts-node": "^10.9.1", - "typescript": "^5.0.4" + "typescript": "^5.0.4", + "vite-node": "^0.30.1" } } diff --git a/src/behaviors/cleanup.ts b/src/behaviors/cleanup.ts deleted file mode 100644 index 0edd9d861..000000000 --- a/src/behaviors/cleanup.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Client, Routes } from 'discord.js'; -import { exit } from 'process'; -import discord from '../../discord.json' assert { type: 'json' }; -import getClientId from '../utilities/getClientId.js'; -import { rest } from './interactionCreate.js'; - -export const EXIT_EVENT_NAMES = [ - 'exit', - 'SIGINT', - 'SIGUSR1', - 'SIGUSR2', - 'uncaughtException', -]; - -export default function cleanup(client: Client) { - console.log('Cleaning up...'); - - console.log('Unregistering public commands...'); - rest.put(Routes.applicationCommands(getClientId()), { body: [] }); - - console.log('Unregistering guild commands...'); - rest.put(Routes.applicationGuildCommands(getClientId(), discord.guild_id), { - body: [], - }); - - console.log('Destroying client...'); - try { - client.destroy(); - } catch (e) { - console.error('Failed to destroy client'); - console.error(e); - } - - console.log('Removing all exit event listeners...'); - EXIT_EVENT_NAMES.forEach((exitEventName) => - process.off(exitEventName, () => cleanup(client)), - ); - - console.log('Exiting...'); - exit(); -} diff --git a/src/behaviors/error.ts b/src/behaviors/error.ts new file mode 100644 index 000000000..848fa6351 --- /dev/null +++ b/src/behaviors/error.ts @@ -0,0 +1,36 @@ +import { Client, EmbedBuilder, TextChannel } from 'discord.js'; +import discord from '../../discord.json' assert { type: 'json' }; +import { NEGATIVE_COLOR } from '../constants/colors.js'; + +export const PROCESS_ERROR_EVENTS = ['uncaughtException']; +export const CLIENT_ERROR_EVENTS = ['error']; + +function handleError(error: Error, client: Client) { + console.error(error); + + ( + client.guilds.cache + .get(discord.guild_id) + ?.channels.cache.get(discord.log_channel) as TextChannel + ).send({ + embeds: [ + new EmbedBuilder() + .setTitle('Skilled Bot ran into a catastrophic error') + .setColor(NEGATIVE_COLOR) + .setDescription( + `Total shutdown was avoided! Error:\n\n\`\`\`${error.name}\n${error.message}\n${error.stack}\n${error.cause}\`\`\``, + ), + ], + }); +} + +export function registerErrorHandlers(client: Client) { + PROCESS_ERROR_EVENTS.forEach((name) => + process.on(name, (error) => handleError(error, client)), + ); + CLIENT_ERROR_EVENTS.forEach((name) => + client.on(name, (error) => handleError(error, client)), + ); + + return client; +} diff --git a/src/behaviors/interactionCreate.ts b/src/behaviors/interactionCreate.ts index fbb68304a..bf2017351 100644 --- a/src/behaviors/interactionCreate.ts +++ b/src/behaviors/interactionCreate.ts @@ -46,23 +46,19 @@ for (const file of commandFolders) { } try { - console.log(`Refreshing ${guildCommands.length} guild command(s).`); - - const guildData = (await rest.put( - Routes.applicationGuildCommands(getClientId(), discord.guild_id), - { body: guildCommands }, - )) as RESTPostAPIChatInputApplicationCommandsJSONBody[]; - - console.log(`Successfully refreshed ${guildData.length} guild command(s).`); - console.log(`Refreshing ${publicCommands.length} public command(s).`); - const publicData = (await rest.put( Routes.applicationCommands(getClientId()), { body: publicCommands }, )) as RESTPostAPIChatInputApplicationCommandsJSONBody[]; - console.log(`Successfully refreshed ${publicData.length} public command(s).`); + + console.log(`Refreshing ${guildCommands.length} guild command(s).`); + const guildData = (await rest.put( + Routes.applicationGuildCommands(getClientId(), discord.guild_id), + { body: guildCommands }, + )) as RESTPostAPIChatInputApplicationCommandsJSONBody[]; + console.log(`Successfully refreshed ${guildData.length} guild command(s).`); } catch (error) { console.error(error); } diff --git a/src/behaviors/ready.ts b/src/behaviors/ready.ts index abe756d4e..dc6d338c6 100644 --- a/src/behaviors/ready.ts +++ b/src/behaviors/ready.ts @@ -1,5 +1,10 @@ -import { Client } from "discord.js"; +import { Client } from 'discord.js'; +import isDev from '../utilities/isDev.js'; -export default function ready(client:Client) { - console.log(`Logged in as ${client.user.tag}!`); -} \ No newline at end of file +export default function ready(client: Client) { + console.log( + `Logged in as ${client.user.tag} in ${ + isDev() ? 'development' : 'production' + } mode`, + ); +} diff --git a/src/commands/debug.ts b/src/commands/debug.ts index 9b98d4b31..1e7e9df13 100644 --- a/src/commands/debug.ts +++ b/src/commands/debug.ts @@ -22,7 +22,7 @@ export default { await interaction.reply({ embeds: [ new EmbedBuilder() - .setTitle('Skilled Bot information') + .setTitle('Skilled Bot debug information') .setColor(SKILLED_COLOR) .setDescription( `**Version**: ${packageJSON.version}\n**Uptime**: ${Math.floor( diff --git a/src/commands/help.ts b/src/commands/help.ts index 15c8ec4a7..0fc7eb052 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -23,7 +23,7 @@ export default { .setTitle('Skilled Bot help') .setColor(SKILLED_COLOR) .setDescription( - `**About**\nSkilled Bot provides many useful commands that automate many mundane tasks and provide statistics in just the right may.\Made by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/sklld/bot\nSkilled: ADD THE LINK HERE I FORGOT\n\n**Commands**\n${(interaction.guildId === + `**About**\nSkilled Bot automates many mundane tasks and provide statistics in many flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/sklld/bot\nSkilled: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId === discord.guild_id ? [...guildCommands, ...publicCommands] : publicCommands @@ -31,7 +31,7 @@ export default { .map((command) => `**/${command.name}**: ${command.description}`) .join( '\n', - )})}\n\n*I am a new bot; I may make mistakes and go offline from time to time.*`, + )}\n\n*I am a new bot; I may make mistakes and go offline unexpectedly from time to time.*`, ), ], }); diff --git a/src/index.ts b/src/index.ts index cb55cea83..82515a285 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { Client, GatewayIntentBits } from 'discord.js'; -import cleanup, { EXIT_EVENT_NAMES } from './behaviors/cleanup.js'; +import { registerErrorHandlers } from './behaviors/error.js'; import guildMemberAdd from './behaviors/guildMemberAdd.js'; import interactionCreate from './behaviors/interactionCreate.js'; import ready from './behaviors/ready.js'; @@ -13,12 +13,8 @@ const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers], }); -client.on('error', console.error); -client.on('ready', ready); -client.on('guildMemberAdd', guildMemberAdd); -client.on('interactionCreate', interactionCreate); -client.login(process.env.DISCORD_TOKEN); - -EXIT_EVENT_NAMES.forEach((exitEventName) => - process.on(exitEventName, () => cleanup(client)), -); +registerErrorHandlers(client) + .on('ready', ready) + .on('guildMemberAdd', guildMemberAdd) + .on('interactionCreate', interactionCreate) + .login(process.env.DISCORD_TOKEN); diff --git a/src/utilities/getBlitzAccount.ts b/src/utilities/getBlitzAccount.ts index a686eb0b2..e80b2ae34 100644 --- a/src/utilities/getBlitzAccount.ts +++ b/src/utilities/getBlitzAccount.ts @@ -7,6 +7,7 @@ import fetch from 'node-fetch'; import { NEGATIVE_COLOR } from '../constants/colors.js'; import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js'; import { Player, Players } from '../types/players.js'; +import wargamingError from './wargamingError.js'; export default async function getBlitzAccount( interaction: ChatInputCommandInteraction, @@ -19,37 +20,37 @@ export default async function getBlitzAccount( `https://api.wotblitz.${server}/wotb/account/list/?application_id=${process.env.WARGAMING_APPLICATION_ID}&search=${name}`, ).then((response) => response.json())) as Players; - if ( - players.status === 'ok' && - players.data.length > 0 && - players.data[0].nickname === name - ) { - callback(players.data[0]); - } else { - // no exact match - await interaction.reply({ - embeds: [ - new EmbedBuilder() - .setColor(NEGATIVE_COLOR) - .setTitle(`Account not found`) - .setDescription( - `I couldn't find "${name}" in the ${serverName} server. I found ${ - players?.data - ? players.data.length < 100 - ? players.data.length - : 'over 100' - : 0 - } similarly spelled account${ - players?.data?.length !== 1 ? 's' : '' - }. ${ - players?.data && players.data.length > 0 - ? `Did you mean "${players.data[0].nickname}"? ` - : '' - }Re-run the command, don't make typos, and capitalize correctly.`, - ), - ], - }); + if (players.status === 'ok') { + if (players.data.length > 0 && players.data[0].nickname === name) { + callback(players.data[0]); + } else { + // no exact match + await interaction.reply({ + embeds: [ + new EmbedBuilder() + .setColor(NEGATIVE_COLOR) + .setTitle(`Account not found`) + .setDescription( + `I couldn't find "${name}" in the ${serverName} server. I found ${ + players?.data + ? players.data.length < 100 + ? players.data.length + : 'over 100' + : 0 + } similarly spelled account${ + players?.data?.length !== 1 ? 's' : '' + }. ${ + players?.data && players.data.length > 0 + ? `Did you mean "${players.data[0].nickname}"? ` + : '' + }Re-run the command, don't make typos, and capitalize correctly.`, + ), + ], + }); - console.log(`Account not found for ${name} in ${serverName} server.`); + console.log(`Account not found for ${name} in ${serverName} server.`); + } + } else { + wargamingError(interaction); } } diff --git a/src/utilities/isDev.ts b/src/utilities/isDev.ts index e8db4aef4..9c6c91ad3 100644 --- a/src/utilities/isDev.ts +++ b/src/utilities/isDev.ts @@ -1,6 +1,4 @@ -import { argv } from 'process'; - -const isDevBoolean = argv.includes('--dev'); +const isDevBoolean = process.argv.includes('--dev'); export default function isDev() { return isDevBoolean; diff --git a/yarn.lock b/yarn.lock index 486457ddc..e12ae3862 100644 --- a/yarn.lock +++ b/yarn.lock @@ -53,6 +53,116 @@ resolved "https://registry.npmjs.org/@discordjs/util/-/util-0.2.0.tgz" integrity sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg== +"@esbuild/android-arm64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz#4aa8d8afcffb4458736ca9b32baa97d7cb5861ea" + integrity sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw== + +"@esbuild/android-arm@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.18.tgz#74a7e95af4ee212ebc9db9baa87c06a594f2a427" + integrity sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw== + +"@esbuild/android-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.18.tgz#1dcd13f201997c9fe0b204189d3a0da4eb4eb9b6" + integrity sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg== + +"@esbuild/darwin-arm64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz#444f3b961d4da7a89eb9bd35cfa4415141537c2a" + integrity sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ== + +"@esbuild/darwin-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz#a6da308d0ac8a498c54d62e0b2bfb7119b22d315" + integrity sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A== + +"@esbuild/freebsd-arm64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz#b83122bb468889399d0d63475d5aea8d6829c2c2" + integrity sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA== + +"@esbuild/freebsd-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz#af59e0e03fcf7f221b34d4c5ab14094862c9c864" + integrity sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew== + +"@esbuild/linux-arm64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz#8551d72ba540c5bce4bab274a81c14ed01eafdcf" + integrity sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ== + +"@esbuild/linux-arm@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz#e09e76e526df4f665d4d2720d28ff87d15cdf639" + integrity sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg== + +"@esbuild/linux-ia32@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz#47878860ce4fe73a36fd8627f5647bcbbef38ba4" + integrity sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ== + +"@esbuild/linux-loong64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz#3f8fbf5267556fc387d20b2e708ce115de5c967a" + integrity sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ== + +"@esbuild/linux-mips64el@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz#9d896d8f3c75f6c226cbeb840127462e37738226" + integrity sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA== + +"@esbuild/linux-ppc64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz#3d9deb60b2d32c9985bdc3e3be090d30b7472783" + integrity sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ== + +"@esbuild/linux-riscv64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz#8a943cf13fd24ff7ed58aefb940ef178f93386bc" + integrity sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA== + +"@esbuild/linux-s390x@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz#66cb01f4a06423e5496facabdce4f7cae7cb80e5" + integrity sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw== + +"@esbuild/linux-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz#23c26050c6c5d1359c7b774823adc32b3883b6c9" + integrity sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA== + +"@esbuild/netbsd-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz#789a203d3115a52633ff6504f8cbf757f15e703b" + integrity sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg== + +"@esbuild/openbsd-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz#d7b998a30878f8da40617a10af423f56f12a5e90" + integrity sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA== + +"@esbuild/sunos-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz#ecad0736aa7dae07901ba273db9ef3d3e93df31f" + integrity sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg== + +"@esbuild/win32-arm64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz#58dfc177da30acf956252d7c8ae9e54e424887c4" + integrity sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg== + +"@esbuild/win32-ia32@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz#340f6163172b5272b5ae60ec12c312485f69232b" + integrity sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw== + +"@esbuild/win32-x64@0.17.18": + version "0.17.18" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz#3a8e57153905308db357fd02f57c180ee3a0a1fa" + integrity sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg== + "@jridgewell/resolve-uri@^3.0.3": version "3.1.1" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz" @@ -131,7 +241,7 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1: +acorn@^8.4.1, acorn@^8.8.2: version "8.8.2" resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -148,6 +258,11 @@ busboy@^1.6.0: dependencies: streamsearch "^1.1.0" +cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + create-require@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" @@ -158,6 +273,13 @@ data-uri-to-buffer@^4.0.0: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz" integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== +debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" @@ -187,6 +309,34 @@ discord.js@^14.9.0: undici "^5.21.0" ws "^8.13.0" +esbuild@^0.17.5: + version "0.17.18" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.18.tgz#f4f8eb6d77384d68cd71c53eb6601c7efe05e746" + integrity sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w== + optionalDependencies: + "@esbuild/android-arm" "0.17.18" + "@esbuild/android-arm64" "0.17.18" + "@esbuild/android-x64" "0.17.18" + "@esbuild/darwin-arm64" "0.17.18" + "@esbuild/darwin-x64" "0.17.18" + "@esbuild/freebsd-arm64" "0.17.18" + "@esbuild/freebsd-x64" "0.17.18" + "@esbuild/linux-arm" "0.17.18" + "@esbuild/linux-arm64" "0.17.18" + "@esbuild/linux-ia32" "0.17.18" + "@esbuild/linux-loong64" "0.17.18" + "@esbuild/linux-mips64el" "0.17.18" + "@esbuild/linux-ppc64" "0.17.18" + "@esbuild/linux-riscv64" "0.17.18" + "@esbuild/linux-s390x" "0.17.18" + "@esbuild/linux-x64" "0.17.18" + "@esbuild/netbsd-x64" "0.17.18" + "@esbuild/openbsd-x64" "0.17.18" + "@esbuild/sunos-x64" "0.17.18" + "@esbuild/win32-arm64" "0.17.18" + "@esbuild/win32-ia32" "0.17.18" + "@esbuild/win32-x64" "0.17.18" + fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" @@ -216,6 +366,11 @@ formdata-polyfill@^4.0.10: dependencies: fetch-blob "^3.1.2" +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + ieee754@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" @@ -226,6 +381,11 @@ inherits@^2.0.3: resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + lodash.snakecase@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz" @@ -241,6 +401,26 @@ make-error@^1.1.1: resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +mlly@^1.1.1, mlly@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.2.0.tgz#f0f6c2fc8d2d12ea6907cd869066689b5031b613" + integrity sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww== + dependencies: + acorn "^8.8.2" + pathe "^1.1.0" + pkg-types "^1.0.2" + ufo "^1.1.1" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nanoid@^3.3.6: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== + node-domexception@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz" @@ -255,11 +435,39 @@ node-fetch@^3.3.1: fetch-blob "^3.1.4" formdata-polyfill "^4.0.10" +pathe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.0.tgz#e2e13f6c62b31a3289af4ba19886c230f295ec03" + integrity sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w== + peek-readable@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/peek-readable/-/peek-readable-5.0.0.tgz" integrity sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A== +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +pkg-types@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.2.tgz#c233efc5210a781e160e0cafd60c0d0510a4b12e" + integrity sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ== + dependencies: + jsonc-parser "^3.2.0" + mlly "^1.1.1" + pathe "^1.1.0" + +postcss@^8.4.23: + version "8.4.23" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.23.tgz#df0aee9ac7c5e53e1075c24a3613496f9e6552ab" + integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA== + dependencies: + nanoid "^3.3.6" + picocolors "^1.0.0" + source-map-js "^1.0.2" + readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" @@ -276,11 +484,23 @@ readable-web-to-node-stream@^3.0.2: dependencies: readable-stream "^3.6.0" +rollup@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.21.0.tgz#0a71517db56e150222670f88e5e7acfa4fede7c8" + integrity sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ== + optionalDependencies: + fsevents "~2.3.2" + safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + streamsearch@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" @@ -343,6 +563,11 @@ typescript@^5.0.4: resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz" integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== +ufo@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.1.tgz#e70265e7152f3aba425bd013d150b2cdf4056d7c" + integrity sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg== + undici@^5.21.0: version "5.21.2" resolved "https://registry.npmjs.org/undici/-/undici-5.21.2.tgz" @@ -360,6 +585,29 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +vite-node@^0.30.1: + version "0.30.1" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.30.1.tgz#ab0ed1553019c7d81ac95529c57ab8ac9e82347d" + integrity sha512-vTikpU/J7e6LU/8iM3dzBo8ZhEiKZEKRznEMm+mJh95XhWaPrJQraT/QsT2NWmuEf+zgAoMe64PKT7hfZ1Njmg== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + mlly "^1.2.0" + pathe "^1.1.0" + picocolors "^1.0.0" + vite "^3.0.0 || ^4.0.0" + +"vite@^3.0.0 || ^4.0.0": + version "4.3.3" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.3.tgz#26adb4aa01439fc4546c480ea547674d87289396" + integrity sha512-MwFlLBO4udZXd+VBcezo3u8mC77YQk+ik+fbc0GZWGgzfbPP+8Kf0fldhARqvSYmtIWoAJ5BXPClUbMTlqFxrA== + dependencies: + esbuild "^0.17.5" + postcss "^8.4.23" + rollup "^3.21.0" + optionalDependencies: + fsevents "~2.3.2" + web-streams-polyfill@^3.0.3: version "3.2.1" resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz"