diff --git a/commands/archive.js b/commands/archive.js
index 1477623..f2581e5 100644
--- a/commands/archive.js
+++ b/commands/archive.js
@@ -1,97 +1,99 @@
+const { Constants } = require('discord.js');
+
module.exports = {
- name: "archive",
- description: "Archives the links from any website to discord",
- async execute(message, args, list, client, Discord) {
+ name: "archive",
+ description: "Archives the links from any website to discord",
+ async execute(interaction, list, client, Discord) {
+ const link = interaction.options.data.filter((arg) => { return (arg.value == 'url'); })[0].value;
- //FUNCTION SECTION START
+ //FUNCTION SECTION START
- function findName(name) {
- return (name == 'instagram' || name == 'twitter' || name == 'reddit' || name == 'youtube' || name == 'other' || name == 'nsfw');
- }
+ function findName(name) {
+ return (name == 'instagram' || name == 'twitter' || name == 'reddit' || name == 'youtube' || name == 'other' || name == 'nsfw');
+ }
- //FUNCTION SECTION END
-
- if (args[0] == "help") {
- message.channel.send("Command Format:\n/archive (link) [thread]\nFormat: (required)[optional]");
- }
- else if (args.length < 1) {
- message.channel.send("ERROR!\nYou are missing arguments!");
- return;
- }
+ //FUNCTION SECTION END
-
- let website = args[0];
- let channelName = website.split("//")[1];
- if (channelName == 0) {
- message.channel.send("Please provide a valid link!");
- return;
- }
- let namesList = ['instagram', 'twitter', 'reddit', 'youtube','other', 'nsfw'];
- let channelNum;
-
- //Check if there is a www
- if (channelName[0] == 'w') {
- channelName = channelName.split(".")[1];
- }
+ if (link == "help") {
+ interaction.channel.send("Command Format:\n/archive (link) [thread]\nFormat: (required)[optional]");
+ }
- //Get the name
- channelName = channelName.split(".")[0];
- //Check for NSFW
- let subch ='General';
- let nsfw = ((channelName.indexOf("porn") != -1) || (channelName.indexOf("hentai") != -1));
-
- //Channel Name Section
- if (findName(channelName)) {
- channelNum = '' + list[namesList.indexOf(channelName)];
+ let website = link;
+ let channelName = website.split("//")[1];
+ if (channelName == 0) {
+ interaction.channel.send("Please provide a valid link!");
+ return;
+ }
+ let namesList = ['instagram', 'twitter', 'reddit', 'youtube', 'other', 'nsfw'];
+ let channelNum;
+
+ //Check if there is a www
+ if (channelName[0] == 'w') {
+ channelName = channelName.split(".")[1];
+ }
+
+ //Get the name
+ channelName = channelName.split(".")[0];
+
+ //Check for NSFW
+ let subch = 'General';
+ let nsfw = ((channelName.indexOf("porn") != -1) || (channelName.indexOf("hentai") != -1));
+
+ //Channel Name Section
+ if (findName(channelName)) {
+ channelNum = '' + list[namesList.indexOf(channelName)];
+ } else {
+ if (nsfw) {
+ subch = channelName;
+ channelName = 'nsfw';
+ channelNum = '' + list[namesList.indexOf('nsfw')];
} else {
- if (nsfw) {
- subch = channelName;
- channelName = 'nsfw';
- channelNum = '' + list[namesList.indexOf('nsfw')];
- } else {
- subch = channelName;
- channelNum = '' + list[namesList.indexOf('other')];
- }
+ subch = channelName;
+ channelNum = '' + list[namesList.indexOf('other')];
+ }
+ }
+
+ const channel = client.channels.cache.get(channelNum);
+
+ //Check if the channel already exists
+ if (channel) {
+ //Thread section
+ let threadName;
+
+ //Get the channel name or default
+ if (interaction.options.data.length > 1) {
+ threadName = interaction.options.data.filter((arg) => { return (arg.value == 'thread'); })[0].value;
+ } else {
+ threadName = subch;
}
- const channel = client.channels.cache.get(channelNum);
+ //Un-archive the thread (if archived)
+ const thread = channel.threads.cache.find(x => x.name === threadName);
+ // await thread.setArchived(false);
+ if (thread == undefined) { console.log(threadName); }
- //Check if the channel already exists
- if (channel) {
- //Thread section
- let threadName;
+ if (thread == undefined) {
+ let ID = interaction.user.id;
+ const thread = await channel.threads.create({
+ name: threadName,
+ autoArchiveDuration: 60,
+ //message.client.users.fetch(ID);
+ reason: 'To archive of course!',
+ });
+ thread.send(link);
- //Get the channel name or default
- if (args.length > 1) {
- threadName = args[1];
- } else {
- threadName = subch;
- }
-
- //Un-archive the thread (if archived)
+ console.log(`Created thread: ${thread.name}`);
+ } else {
const thread = channel.threads.cache.find(x => x.name === threadName);
- // await thread.setArchived(false);
- if (thread == undefined) { console.log(threadName); }
-
- if (thread == undefined) {
- let ID = message.member.id;
- const thread = await channel.threads.create({
- name: threadName,
- autoArchiveDuration: 60,
- //message.client.users.fetch(ID);
- reason: 'N/A',
- });
- thread.send(args[0]);
-
- console.log(`Created thread: ${thread.name}`);
- } else {
- const thread = channel.threads.cache.find(x => x.name === threadName);
- //await thread.setArchived(false); //Unarchive
- thread.send(args[0]);
- }
- } else {
- message.channel.send("Uh oh, looks like this channel doesn't exist yet!");
+ //await thread.setArchived(false); //Unarchive
+ thread.send(link);
}
- }
+ } else {
+ interaction.channel.send("Uh oh, looks like this channel doesn't exist yet!");
+ }
+ }, options: [
+ {name: 'url', description: 'The URL to archive', type: Constants.ApplicationCommandOptionTypes.STRING, required: true },
+ {name: 'thread', description: 'The thread name (defaults to "General" or "NSFW"', type: Constants.ApplicationCommandOptionTypes.STRING, required: false }
+ ]
}
\ No newline at end of file
diff --git a/index.js b/index.js
index 1ac0d8b..4400316 100644
--- a/index.js
+++ b/index.js
@@ -24,7 +24,7 @@ const nsfw = process.env['nsfw'];
const list = [inst, twit, redd, you, oth, nsfw]
-const client = new Client({
+const bot = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
@@ -36,43 +36,43 @@ const prefix = '/';
const emojiPrefix = "<:archive:";
const fs = require('fs');
-const { exit } = require('process');
-client.commands = new Discord.Collection();
-client.commNames = new Discord.Collection();
+// client.commands = new Discord.Collection();
+// client.commNames = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
let i = 0;
+const commands = bot.application.commands;
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
- client.commands.set(command.name, command);
- client.commNames.set(i, [command.name, command.description]);
+ commands.create({
+ name: command.name,
+ description: command.description,
+ options: command.options,
+ dm_permission: false,
+ });
i ++;
}
+client.on('interactionCreate', async interaction => {
+ const { commandName } = interaction;
-client.commNames.set('length', i);
-
-
+ if (commandName == 'archive') {
+ const arch = require('./commands/archive.js');
+ arch.execute(interaction, list, bot, Discord);
+ } else {
+ interaction.reply("Invalid Command!");
+ }
+});
// client.on('ready', () => {
// console.log('Archive Bot online!');
// });
+/*
client.on('messageCreate', (message) => {
-
- /*//PREVIEW COMMANDS START
- const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
-
- lib.discord.commands['@0.0.0'].create({
- "name": "test",
- "description": "it's a test command!",
- "options": []
- });
-
- //PREVIEW COMMANDS END*/
//COMMAND AREA
//Check if the prefix exists
@@ -100,8 +100,8 @@ client.on('messageCreate', (message) => {
default: message.channel.send("'" + message.content + "' is not a command!");
}
})
-
+*/
//Last Line
-client.login(token);
\ No newline at end of file
+bot.login(token);
\ No newline at end of file
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index cc8b2be..2d1dcc6 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -4,59 +4,66 @@
"requires": true,
"packages": {
"node_modules/@discordjs/builders": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz",
- "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==",
+ "version": "0.16.0",
+ "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz",
+ "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==",
+ "deprecated": "no longer supported",
"dependencies": {
- "@sindresorhus/is": "^4.2.0",
- "discord-api-types": "^0.26.0",
- "ts-mixer": "^6.0.0",
- "tslib": "^2.3.1",
- "zod": "^3.11.6"
+ "@sapphire/shapeshift": "^3.5.1",
+ "discord-api-types": "^0.36.2",
+ "fast-deep-equal": "^3.1.3",
+ "ts-mixer": "^6.0.1",
+ "tslib": "^2.4.0"
},
"engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
+ "node": ">=16.9.0"
}
},
+ "node_modules/@discordjs/builders/node_modules/discord-api-types": {
+ "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/@discordjs/collection": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz",
- "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==",
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz",
+ "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==",
+ "deprecated": "no longer supported",
"engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
+ "node": ">=16.9.0"
}
},
"node_modules/@sapphire/async-queue": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.0.tgz",
- "integrity": "sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.0.tgz",
+ "integrity": "sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA==",
"engines": {
"node": ">=v14.0.0",
"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"
+ "node_modules/@sapphire/shapeshift": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.6.0.tgz",
+ "integrity": "sha512-tu2WLRdo5wotHRvsCkspg3qMiP6ETC3Q1dns1Q5V6zKUki+1itq6AbhMwohF9ZcLoYqg+Y8LkgRRtVxxTQVTBQ==",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "lodash.uniqwith": "^4.5.0"
},
- "funding": {
- "url": "https://github.com/sindresorhus/is?sponsor=1"
+ "engines": {
+ "node": ">=v14.0.0",
+ "npm": ">=7.0.0"
}
},
"node_modules/@types/node": {
- "version": "17.0.23",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz",
- "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw=="
+ "version": "18.7.22",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.22.tgz",
+ "integrity": "sha512-TsmoXYd4zrkkKjJB0URF/mTIKPl+kVcbqClB2F/ykU7vil1BfWZVndOnpEIozPv4fURD28gyPFeIkW2G+KXOvw=="
},
"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==",
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
+ "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
"dependencies": {
"@types/node": "*",
"form-data": "^3.0.0"
@@ -98,31 +105,34 @@
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
- "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/body-parser": {
- "version": "1.19.2",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz",
- "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
+ "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
"debug": "2.6.9",
- "depd": "~1.1.2",
- "http-errors": "1.8.1",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "http-errors": "2.0.0",
"iconv-lite": "0.4.24",
- "on-finished": "~2.3.0",
- "qs": "6.9.7",
- "raw-body": "2.4.3",
- "type-is": "~1.6.18"
+ "on-finished": "2.4.1",
+ "qs": "6.10.3",
+ "raw-body": "2.5.1",
+ "type-is": "~1.6.18",
+ "unpipe": "1.0.0"
},
"engines": {
- "node": ">= 0.8"
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/bytes": {
@@ -133,6 +143,18 @@
"node": ">= 0.8"
}
},
+ "node_modules/call-bind": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
+ "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "get-intrinsic": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -164,9 +186,9 @@
}
},
"node_modules/cookie": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
- "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
+ "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"engines": {
"node": ">= 0.6"
}
@@ -174,12 +196,12 @@
"node_modules/cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
- "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
+ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"node_modules/daemon": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/daemon/-/daemon-1.1.0.tgz",
- "integrity": "sha1-bFECyB2wvoVvyQCPwsk1s5iGSug=",
+ "integrity": "sha512-1vX9YVcP21gt12nSD3SQRC/uPU7fyA6M8qyClTBIFuiRWoylFn57PwXhjBAqRl085bZAje7sILhZU48qcS9SWw==",
"engines": {
"node": ">= 0.8.0"
}
@@ -195,46 +217,47 @@
"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=",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/depd": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
- "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"engines": {
- "node": ">= 0.6"
+ "node": ">= 0.8"
}
},
"node_modules/destroy": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
- "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
- },
- "node_modules/discord-api-types": {
- "version": "0.26.1",
- "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz",
- "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
"engines": {
- "node": ">=12"
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/discord-api-types": {
+ "version": "0.33.5",
+ "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz",
+ "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg=="
+ },
"node_modules/discord.js": {
- "version": "13.6.0",
- "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz",
- "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==",
+ "version": "13.11.0",
+ "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.11.0.tgz",
+ "integrity": "sha512-/vA6oQtKilFlwVZSIFipPeWg5kU6gjUOffuaYWtDDJwIXKqiThNdymLkmQhnf8Ztlt+3vKsoqXENrgpQdaNCVQ==",
"dependencies": {
- "@discordjs/builders": "^0.11.0",
- "@discordjs/collection": "^0.4.0",
- "@sapphire/async-queue": "^1.1.9",
- "@types/node-fetch": "^2.5.12",
- "@types/ws": "^8.2.2",
- "discord-api-types": "^0.26.0",
+ "@discordjs/builders": "^0.16.0",
+ "@discordjs/collection": "^0.7.0",
+ "@sapphire/async-queue": "^1.5.0",
+ "@types/node-fetch": "^2.6.2",
+ "@types/ws": "^8.5.3",
+ "discord-api-types": "^0.33.5",
"form-data": "^4.0.0",
- "node-fetch": "^2.6.1",
- "ws": "^8.4.0"
+ "node-fetch": "^2.6.7",
+ "ws": "^8.8.1"
},
"engines": {
"node": ">=16.6.0",
@@ -244,12 +267,12 @@
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
- "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"engines": {
"node": ">= 0.8"
}
@@ -257,48 +280,49 @@
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
- "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/express": {
- "version": "4.17.3",
- "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz",
- "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==",
+ "version": "4.18.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
+ "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
- "body-parser": "1.19.2",
+ "body-parser": "1.20.0",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
- "cookie": "0.4.2",
+ "cookie": "0.5.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
- "depd": "~1.1.2",
+ "depd": "2.0.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
- "finalhandler": "~1.1.2",
+ "finalhandler": "1.2.0",
"fresh": "0.5.2",
+ "http-errors": "2.0.0",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
- "on-finished": "~2.3.0",
+ "on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7",
- "qs": "6.9.7",
+ "qs": "6.10.3",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
- "send": "0.17.2",
- "serve-static": "1.14.2",
+ "send": "0.18.0",
+ "serve-static": "1.15.0",
"setprototypeof": "1.2.0",
- "statuses": "~1.5.0",
+ "statuses": "2.0.1",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
@@ -307,17 +331,22 @@
"node": ">= 0.10.0"
}
},
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
"node_modules/finalhandler": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
- "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
+ "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
"dependencies": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
- "on-finished": "~2.3.0",
+ "on-finished": "2.4.1",
"parseurl": "~1.3.3",
- "statuses": "~1.5.0",
+ "statuses": "2.0.1",
"unpipe": "~1.0.0"
},
"engines": {
@@ -348,24 +377,64 @@
"node_modules/fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
- "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"engines": {
"node": ">= 0.6"
}
},
- "node_modules/http-errors": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
- "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "node_modules/function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
+ "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"dependencies": {
- "depd": "~1.1.2",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
+ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+ "dependencies": {
+ "depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
- "statuses": ">= 1.5.0 < 2",
+ "statuses": "2.0.1",
"toidentifier": "1.0.1"
},
"engines": {
- "node": ">= 0.6"
+ "node": ">= 0.8"
}
},
"node_modules/iconv-lite": {
@@ -387,7 +456,7 @@
"node_modules/init": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/init/-/init-0.1.2.tgz",
- "integrity": "sha1-mIKsFScHvMun/iIHyN+AUIdcFQQ=",
+ "integrity": "sha512-IvHUjULS2q+BXJdiu4FHkByh3+qSFmkOXQ2ItSfYTtkdUksQc0yNX6f1uDyokzRV71tjpFsFc3ckeYLJXunTGw==",
"dependencies": {
"daemon": ">=0.3.0"
},
@@ -403,10 +472,15 @@
"node": ">= 0.10"
}
},
+ "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/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
- "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
"engines": {
"node": ">= 0.6"
}
@@ -414,12 +488,12 @@
"node_modules/merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
- "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
+ "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
},
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
- "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"engines": {
"node": ">= 0.6"
}
@@ -457,7 +531,7 @@
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"node_modules/negotiator": {
"version": "0.6.3",
@@ -486,10 +560,18 @@
}
}
},
+ "node_modules/object-inspect": {
+ "version": "1.12.2",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
+ "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/on-finished": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
- "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dependencies": {
"ee-first": "1.1.1"
},
@@ -508,7 +590,7 @@
"node_modules/path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
- "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
+ "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"node_modules/proxy-addr": {
"version": "2.0.7",
@@ -523,9 +605,12 @@
}
},
"node_modules/qs": {
- "version": "6.9.7",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz",
- "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==",
+ "version": "6.10.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
+ "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
+ "dependencies": {
+ "side-channel": "^1.0.4"
+ },
"engines": {
"node": ">=0.6"
},
@@ -542,12 +627,12 @@
}
},
"node_modules/raw-body": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz",
- "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==",
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
+ "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"dependencies": {
"bytes": "3.1.2",
- "http-errors": "1.8.1",
+ "http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
},
@@ -580,23 +665,23 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/send": {
- "version": "0.17.2",
- "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz",
- "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==",
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
+ "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
"dependencies": {
"debug": "2.6.9",
- "depd": "~1.1.2",
- "destroy": "~1.0.4",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
- "http-errors": "1.8.1",
+ "http-errors": "2.0.0",
"mime": "1.6.0",
"ms": "2.1.3",
- "on-finished": "~2.3.0",
+ "on-finished": "2.4.1",
"range-parser": "~1.2.1",
- "statuses": "~1.5.0"
+ "statuses": "2.0.1"
},
"engines": {
"node": ">= 0.8.0"
@@ -608,14 +693,14 @@
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"node_modules/serve-static": {
- "version": "1.14.2",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz",
- "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
+ "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
"dependencies": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
- "send": "0.17.2"
+ "send": "0.18.0"
},
"engines": {
"node": ">= 0.8.0"
@@ -626,12 +711,25 @@
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
+ "node_modules/side-channel": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+ "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "get-intrinsic": "^1.0.2",
+ "object-inspect": "^1.9.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/statuses": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
- "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"engines": {
- "node": ">= 0.6"
+ "node": ">= 0.8"
}
},
"node_modules/toidentifier": {
@@ -645,7 +743,7 @@
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"node_modules/ts-mixer": {
"version": "6.0.1",
@@ -653,9 +751,9 @@
"integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg=="
},
"node_modules/tslib": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
- "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
+ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/type-is": {
"version": "1.6.18",
@@ -672,7 +770,7 @@
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
- "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"engines": {
"node": ">= 0.8"
}
@@ -680,7 +778,7 @@
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
- "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
"engines": {
"node": ">= 0.4.0"
}
@@ -688,7 +786,7 @@
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
- "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"engines": {
"node": ">= 0.8"
}
@@ -696,21 +794,21 @@
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/ws": {
- "version": "8.5.0",
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
- "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz",
+ "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==",
"engines": {
"node": ">=10.0.0"
},
@@ -726,14 +824,6 @@
"optional": true
}
}
- },
- "node_modules/zod": {
- "version": "3.14.2",
- "resolved": "https://registry.npmjs.org/zod/-/zod-3.14.2.tgz",
- "integrity": "sha512-iF+wrtzz7fQfkmn60PG6XFxaWBhYYKzp2i+nv24WbLUWb2JjymdkHlzBwP0erpc78WotwP5g9AAu7Sk8GWVVNw==",
- "funding": {
- "url": "https://github.com/sponsors/colinhacks"
- }
}
}
}
diff --git a/node_modules/@discordjs/builders/CHANGELOG.md b/node_modules/@discordjs/builders/CHANGELOG.md
new file mode 100644
index 0000000..97ab7e5
--- /dev/null
+++ b/node_modules/@discordjs/builders/CHANGELOG.md
@@ -0,0 +1,246 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+# [@discordjs/builders@0.16.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.15.0...@discordjs/builders@0.16.0) - (2022-07-17)
+
+## Bug Fixes
+
+- Slash command name regex (#8265) ([32f9056](https://github.com/discordjs/discord.js/commit/32f9056b15edede3bab07de96afb4b56d3a9ecca))
+- **TextInputBuilder:** Parse `custom_id`, `label`, and `style` (#8216) ([2d9dfa3](https://github.com/discordjs/discord.js/commit/2d9dfa3c6ea4bb972da2f7e088d148b798c866d9))
+
+## Documentation
+
+- Add codecov coverage badge to readmes (#8226) ([f6db285](https://github.com/discordjs/discord.js/commit/f6db285c073898a749fe4591cbd4463d1896daf5))
+
+## Features
+
+- **builder:** Add max min length in string option (#8214) ([96c8d21](https://github.com/discordjs/discord.js/commit/96c8d21f95eb366c46ae23505ba9054f44821b25))
+- Codecov (#8219) ([f10f4cd](https://github.com/discordjs/discord.js/commit/f10f4cdcd88ca6be7ec735ed3a415ba13da83db0))
+- **docgen:** Update typedoc ([b3346f4](https://github.com/discordjs/discord.js/commit/b3346f4b9b3d4f96443506643d4631dc1c6d7b21))
+- Website (#8043) ([127931d](https://github.com/discordjs/discord.js/commit/127931d1df7a2a5c27923c2f2151dbf3824e50cc))
+- **docgen:** Typescript support ([3279b40](https://github.com/discordjs/discord.js/commit/3279b40912e6aa61507bedb7db15a2b8668de44b))
+- Docgen package (#8029) ([8b979c0](https://github.com/discordjs/discord.js/commit/8b979c0245c42fd824d8e98745ee869f5360fc86))
+
+## Refactor
+
+- **builder:** Remove `unsafe*Builder`s (#8074) ([a4d1862](https://github.com/discordjs/discord.js/commit/a4d18629828234f43f03d1bd4851d4b727c6903b))
+- Remove @sindresorhus/is as it's now esm only (#8133) ([c6f285b](https://github.com/discordjs/discord.js/commit/c6f285b7b089b004776fbeb444fe973a68d158d8))
+- Move all the config files to root (#8033) ([769ea0b](https://github.com/discordjs/discord.js/commit/769ea0bfe78c4f1d413c6b397c604ffe91e39c6a))
+
+## Typings
+
+- Remove expect error (#8242) ([7e6dbaa](https://github.com/discordjs/discord.js/commit/7e6dbaaed900c07d1a04e23bbbf9cd0d1b0501c5))
+- **builder:** Remove casting (#8241) ([8198da5](https://github.com/discordjs/discord.js/commit/8198da5cd0898e06954615a2287853321e7ebbd4))
+
+# [@discordjs/builders@0.15.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.14.0...@discordjs/builders@0.15.0) - (2022-06-06)
+
+## Features
+
+- Allow builders to accept rest params and arrays (#7874) ([ad75be9](https://github.com/discordjs/discord.js/commit/ad75be9a9cf90c8624495df99b75177e6c24022f))
+- Use vitest instead of jest for more speed ([8d8e6c0](https://github.com/discordjs/discord.js/commit/8d8e6c03decd7352a2aa180f6e5bc1a13602539b))
+- Add scripts package for locally used scripts ([f2ae1f9](https://github.com/discordjs/discord.js/commit/f2ae1f9348bfd893332a9060f71a8a5f272a1b8b))
+
+# [@discordjs/builders@0.15.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.14.0...@discordjs/builders@0.15.0) - (2022-06-05)
+
+## Features
+
+- Allow builders to accept rest params and arrays (#7874) ([ad75be9](https://github.com/discordjs/discord.js/commit/ad75be9a9cf90c8624495df99b75177e6c24022f))
+- Use vitest instead of jest for more speed ([8d8e6c0](https://github.com/discordjs/discord.js/commit/8d8e6c03decd7352a2aa180f6e5bc1a13602539b))
+- Add scripts package for locally used scripts ([f2ae1f9](https://github.com/discordjs/discord.js/commit/f2ae1f9348bfd893332a9060f71a8a5f272a1b8b))
+
+# [@discordjs/builders@0.14.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.13.0...@discordjs/builders@0.14.0) - (2022-06-04)
+
+## Bug Fixes
+
+- **builders:** Leftover invalid null type ([8a7cd10](https://github.com/discordjs/discord.js/commit/8a7cd10554a2a71cd2fe7f6a177b5f4f43464348))
+- **SlashCommandBuilder:** Import `Permissions` correctly (#7921) ([7ce641d](https://github.com/discordjs/discord.js/commit/7ce641d33a4af6586d5e7beffbe7d38619dcf1a2))
+- Add localizations for subcommand builders and option choices (#7862) ([c1b5e73](https://github.com/discordjs/discord.js/commit/c1b5e731daa9cbbfca03a046e47cb1221ee1ed7c))
+
+## Features
+
+- Export types from `interactions/slashCommands/mixins` (#7942) ([68d5169](https://github.com/discordjs/discord.js/commit/68d5169f66c96f8fe5be17a1c01cdd5155607ab2))
+- **builders:** Add new command permissions v2 (#7861) ([de3f157](https://github.com/discordjs/discord.js/commit/de3f1573f07dda294cc0fbb1ca4b659eb2388a12))
+- **builders:** Improve embed errors and predicates (#7795) ([ec8d87f](https://github.com/discordjs/discord.js/commit/ec8d87f93272cc9987f9613735c0361680c4ed1e))
+
+## Refactor
+
+- Use arrays instead of rest parameters for builders (#7759) ([29293d7](https://github.com/discordjs/discord.js/commit/29293d7bbb5ed463e52e5a5853817e5a09cf265b))
+
+## Styling
+
+- Cleanup tests and tsup configs ([6b8ef20](https://github.com/discordjs/discord.js/commit/6b8ef20cb3af5b5cfd176dd0aa0a1a1e98551629))
+
+# [@discordjs/builders@0.13.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.12.0...@discordjs/builders@0.13.0) - (2022-04-17)
+
+## Bug Fixes
+
+- Validate select menu options (#7566) ([b1d63d9](https://github.com/discordjs/discord.js/commit/b1d63d919a61f309ac89f27016b0f148678dac2b))
+- **SelectMenu:** Set `placeholder` max to 150 (#7538) ([dcd4797](https://github.com/discordjs/discord.js/commit/dcd479767b6ec980a373f2ea1f22754f41661c1e))
+- Only check `instanceof Component` once (#7546) ([0aa4851](https://github.com/discordjs/discord.js/commit/0aa48516a4e33497e8e8dc50da164a57cdee09d3))
+- **builders:** Allow negative min/max value of number/integer option (#7484) ([3baa340](https://github.com/discordjs/discord.js/commit/3baa340821b8ecf8a16253bc0917a1033250d7c9))
+- **components:** SetX should take rest parameters (#7461) ([3617359](https://github.com/discordjs/discord.js/commit/36173590a712f041b087b7882054805a8bd42dae))
+- Unsafe embed builder field normalization (#7418) ([b936103](https://github.com/discordjs/discord.js/commit/b936103395121cb21a8c616f669ddab1d2efb0f1))
+- Fix some typos (#7393) ([92a04f4](https://github.com/discordjs/discord.js/commit/92a04f4d98f6c6760214034cc8f5a1eaa78893c7))
+- **builders:** Make type optional in constructor (#7391) ([4abb28c](https://github.com/discordjs/discord.js/commit/4abb28c0a1256c57a60369a6b8ec9e98c265b489))
+- Don't create new instances of builders classes (#7343) ([d6b56d0](https://github.com/discordjs/discord.js/commit/d6b56d0080c4c5f8ace731f1e8bcae0c9d3fb5a5))
+
+## Documentation
+
+- Completely fix builders example link (#7543) ([1a14c0c](https://github.com/discordjs/discord.js/commit/1a14c0ca562ea173d363a770a0437209f461fd23))
+- Add slash command builders example, fixes #7338 (#7339) ([3ae6f3c](https://github.com/discordjs/discord.js/commit/3ae6f3c313091151245d6e6b52337b459ecfc765))
+
+## Features
+
+- Slash command localization for builders (#7683) ([40b9a1d](https://github.com/discordjs/discord.js/commit/40b9a1d67d0b508ec593e030913acd8161cd17f8))
+- Add API v10 support (#7477) ([72577c4](https://github.com/discordjs/discord.js/commit/72577c4bfd02524a27afb6ff4aebba9301a690d3))
+- Add support for module: NodeNext in TS and ESM (#7598) ([8f1986a](https://github.com/discordjs/discord.js/commit/8f1986a6aa98365e09b00e84ad5f9f354ab61f3d))
+- Add Modals and Text Inputs (#7023) ([ed92015](https://github.com/discordjs/discord.js/commit/ed920156344233241a21b0c0b99736a3a855c23c))
+- Add missing `v13` component methods (#7466) ([f7257f0](https://github.com/discordjs/discord.js/commit/f7257f07655076eabfe355cb6a53260b39ca9670))
+- **builders:** Add attachment command option type (#7203) ([ae0f35f](https://github.com/discordjs/discord.js/commit/ae0f35f51d68dfa5a7dc43d161ef9365171debdb))
+- **components:** Add unsafe message component builders (#7387) ([6b6222b](https://github.com/discordjs/discord.js/commit/6b6222bf513d1ee8cd98fba0ad313def560b864f))
+- **embed:** Add setFields (#7322) ([bcc5cda](https://github.com/discordjs/discord.js/commit/bcc5cda8a902ddb28c7e3578e0f29b4272832624))
+
+## Refactor
+
+- Remove nickname parsing (#7736) ([78a3afc](https://github.com/discordjs/discord.js/commit/78a3afcd7fdac358e06764cc0d675e1215c785f3))
+- Replace zod with shapeshift (#7547) ([3c0bbac](https://github.com/discordjs/discord.js/commit/3c0bbac82fa9988af4a62ff00c66d149fbe6b921))
+- Remove store channels (#7634) ([aedddb8](https://github.com/discordjs/discord.js/commit/aedddb875e740e1f1bd77f06ce1b361fd3b7bc36))
+- Allow builders to accept emoji strings (#7616) ([fb9a9c2](https://github.com/discordjs/discord.js/commit/fb9a9c221121ee1c7986f9c775b77b9691a0ae15))
+- Don't return builders from API data (#7584) ([549716e](https://github.com/discordjs/discord.js/commit/549716e4fcec89ca81216a6d22aa8e623175e37a))
+- Remove obsolete builder methods (#7590) ([10607db](https://github.com/discordjs/discord.js/commit/10607dbdafe257c5cbf5b952b7eecec4919e8b4a))
+- **Embed:** Remove add field (#7522) ([8478d2f](https://github.com/discordjs/discord.js/commit/8478d2f4de9ac013733850cbbc67902f7c5abc55))
+- Make `data` public in builders (#7486) ([ba31203](https://github.com/discordjs/discord.js/commit/ba31203a0ad96e0a00f8312c397889351e4c5cfd))
+- **embed:** Remove array support in favor of rest params (#7498) ([b3fa2ec](https://github.com/discordjs/discord.js/commit/b3fa2ece402839008738ad3adce3db958445838d))
+- **components:** Default set boolean methods to true (#7502) ([b122149](https://github.com/discordjs/discord.js/commit/b12214922cea2f43afbe6b1555a74a3c8e16f798))
+- Make public builder props getters (#7422) ([e8252ed](https://github.com/discordjs/discord.js/commit/e8252ed3b981a4b7e4013f12efadd2f5d9318d3e))
+- **builders-methods:** Make methods consistent (#7395) ([f495364](https://github.com/discordjs/discord.js/commit/f4953647ff9f39127978c73bf8a62c08462802ca))
+- Remove conditional autocomplete option return types (#7396) ([0909824](https://github.com/discordjs/discord.js/commit/09098240bfb13b8afafa4ab549f06d236e0ff1c9))
+- **embed:** Mark properties as readonly (#7332) ([31768fc](https://github.com/discordjs/discord.js/commit/31768fcd69ed5b4566a340bda89ce881418e8272))
+
+## Typings
+
+- Fix regressions (#7649) ([5748dbe](https://github.com/discordjs/discord.js/commit/5748dbe08783beb80c526de38ccd105eb0e82664))
+
+# [@discordjs/builders@0.12.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@0.11.0...@discordjs/builders@0.12.0) - (2022-01-24)
+
+## Bug Fixes
+
+- **builders:** Dont export `Button` component stuff twice (#7289) ([86d9d06](https://github.com/discordjs/discord.js/commit/86d9d0674347c08d056cd054cb4ce4253195bf94))
+
+## Documentation
+
+- **SlashCommandSubcommands:** Updating old links from Discord developer portal (#7224) ([bd7a6f2](https://github.com/discordjs/discord.js/commit/bd7a6f265212624199fb0b2ddc8ece39759c63de))
+
+## Features
+
+- Add components to /builders (#7195) ([2bb40fd](https://github.com/discordjs/discord.js/commit/2bb40fd767cf5918e3ba422ff73082734bfa05b0))
+
+## Typings
+
+- Make `required` a boolean (#7307) ([c10afea](https://github.com/discordjs/discord.js/commit/c10afeadc702ab98bec5e077b3b92494a9596f9c))
+
+# [0.11.0](https://github.com/discordjs/builders/compare/v0.10.0...v0.11.0) (2021-12-29)
+
+## Bug Fixes
+
+- **ApplicationCommandOptions:** clean up code for builder options ([#68](https://github.com/discordjs/builders/issues/68)) ([b5d0b15](https://github.com/discordjs/builders/commit/b5d0b157b1262bd01fa011f8e0cf33adb82776e7))
+
+# [0.10.0](https://github.com/discordjs/builders/compare/v0.9.0...v0.10.0) (2021-12-24)
+
+## Bug Fixes
+
+- use zod instead of ow for max/min option validation ([#66](https://github.com/discordjs/builders/issues/66)) ([beb35fb](https://github.com/discordjs/builders/commit/beb35fb1f65bd6be2321e17cc792f67e8615fd48))
+
+## Features
+
+- add max/min option for int and number builder options ([#47](https://github.com/discordjs/builders/issues/47)) ([2e1e860](https://github.com/discordjs/builders/commit/2e1e860b46e3453398b20df63dabb6d4325e32d1))
+
+# [0.9.0](https://github.com/discordjs/builders/compare/v0.8.2...v0.9.0) (2021-12-02)
+
+## Bug Fixes
+
+- replace ow with zod ([#58](https://github.com/discordjs/builders/issues/58)) ([0b6fb81](https://github.com/discordjs/builders/commit/0b6fb8161b858e42781855fb73aaa873fec58160))
+
+## Features
+
+- **SlashCommandBuilder:** add autocomplete ([#53](https://github.com/discordjs/builders/issues/53)) ([05b07a7](https://github.com/discordjs/builders/commit/05b07a7e88848188c27d7380d9f948cba25ef778))
+
+## [0.8.2](https://github.com/discordjs/builders/compare/v0.8.1...v0.8.2) (2021-10-30)
+
+## Bug Fixes
+
+- downgrade ow because of esm issues ([#55](https://github.com/discordjs/builders/issues/55)) ([3722d2c](https://github.com/discordjs/builders/commit/3722d2c1109a7a5c0abad63c1a7eb944df6e46c8))
+
+## [0.8.1](https://github.com/discordjs/builders/compare/v0.8.0...v0.8.1) (2021-10-29)
+
+## Bug Fixes
+
+- documentation ([e33ec8d](https://github.com/discordjs/builders/commit/e33ec8dfd5785312f82e0afb017a3dac614fd71d))
+
+# [0.7.0](https://github.com/discordjs/builders/compare/v0.6.0...v0.7.0) (2021-10-18)
+
+## Bug Fixes
+
+- properly type `toJSON` methods ([#34](https://github.com/discordjs/builders/issues/34)) ([7723ad0](https://github.com/discordjs/builders/commit/7723ad0da169386e638188de220451a97513bc25))
+
+## Features
+
+- **ContextMenus:** add context menu command builder ([#29](https://github.com/discordjs/builders/issues/29)) ([f0641e5](https://github.com/discordjs/builders/commit/f0641e55733de8992600f3082bcf054e6f815cf7))
+- add support for channel types on channel options ([#41](https://github.com/discordjs/builders/issues/41)) ([f6c187e](https://github.com/discordjs/builders/commit/f6c187e0ad6ebe03e65186ece3e95cb1db5aeb50))
+
+# [0.6.0](https://github.com/discordjs/builders/compare/v0.5.0...v0.6.0) (2021-08-24)
+
+## Bug Fixes
+
+- **SlashCommandBuilder:** allow subcommands and groups to coexist at the root level ([#26](https://github.com/discordjs/builders/issues/26)) ([0be4daf](https://github.com/discordjs/builders/commit/0be4dafdfc0b5747c880be0078c00ada913eb4fb))
+
+## Features
+
+- create `Embed` builder ([#11](https://github.com/discordjs/builders/issues/11)) ([eb942a4](https://github.com/discordjs/builders/commit/eb942a4d1f3bcec9a4e370b6af602a713ad8f9b7))
+- **SlashCommandBuilder:** create setDefaultPermission function ([#19](https://github.com/discordjs/builders/issues/19)) ([5d53759](https://github.com/discordjs/builders/commit/5d537593937a8da330153ce4711b7d093a80330e))
+- **SlashCommands:** add number option type ([#23](https://github.com/discordjs/builders/issues/23)) ([1563991](https://github.com/discordjs/builders/commit/1563991d421bb07bf7a412c87e7613692d770f04))
+
+# [0.5.0](https://github.com/discordjs/builders/compare/v0.3.0...v0.5.0) (2021-08-10)
+
+## Features
+
+- **Formatters:** add `formatEmoji` ([#20](https://github.com/discordjs/builders/issues/20)) ([c3d8bb5](https://github.com/discordjs/builders/commit/c3d8bb5363a1d46b45c0def4277da6921e2ba209))
+
+# [0.4.0](https://github.com/discordjs/builders/compare/v0.3.0...v0.4.0) (2021-08-05)
+
+## Features
+
+- `sub command` => `subcommand` ([#18](https://github.com/discordjs/builders/pull/18)) ([95599c5](https://github.com/discordjs/builders/commit/95599c5b5366ebd054c4c277c52f1a44cda1209d))
+
+# [0.3.0](https://github.com/discordjs/builders/compare/v0.2.0...v0.3.0) (2021-08-01)
+
+## Bug Fixes
+
+- **Shrug:** Update comment ([#14](https://github.com/discordjs/builders/issues/14)) ([6fa6c40](https://github.com/discordjs/builders/commit/6fa6c405f2ea733811677d3d1bfb1e2806d504d5))
+- shrug face rendering ([#13](https://github.com/discordjs/builders/issues/13)) ([6ad24ec](https://github.com/discordjs/builders/commit/6ad24ecd96c82b0f576e78e9e53fc7bf9c36ef5d))
+
+## Features
+
+- **formatters:** mentions ([#9](https://github.com/discordjs/builders/issues/9)) ([f83fe99](https://github.com/discordjs/builders/commit/f83fe99b83188ed999845751ffb005c687dbd60a))
+- **Formatters:** Add a spoiler function ([#16](https://github.com/discordjs/builders/issues/16)) ([c213a6a](https://github.com/discordjs/builders/commit/c213a6abb114f65653017a4edec4bdba2162d771))
+- **SlashCommands:** add slash command builders ([#3](https://github.com/discordjs/builders/issues/3)) ([6aa3af0](https://github.com/discordjs/builders/commit/6aa3af07b0ee342fff91f080914bb12b3ab773f8))
+- shrug, tableflip and unflip strings ([#5](https://github.com/discordjs/builders/issues/5)) ([de5fa82](https://github.com/discordjs/builders/commit/de5fa823cd6f1feba5b2d0a63b2cb1761dfd1814))
+
+# [0.2.0](https://github.com/discordjs/builders/compare/v0.1.1...v0.2.0) (2021-07-03)
+
+## Features
+
+- **Formatters:** added `hyperlink` and `hideLinkEmbed` ([#4](https://github.com/discordjs/builders/issues/4)) ([c532daf](https://github.com/discordjs/builders/commit/c532daf2ba2feae75bf9668f63462e96a5314cff))
+
+# [0.1.1](https://github.com/discordjs/builders/compare/v0.1.0...v0.1.1) (2021-06-30)
+
+## Bug Fixes
+
+- **Deps:** added `tslib` as dependency ([#2](https://github.com/discordjs/builders/issues/2)) ([5576ff3](https://github.com/discordjs/builders/commit/5576ff3b67136b957bed0ab8a4c655d5de322813))
+
+# 0.1.0 (2021-06-30)
+
+## Features
+
+- added message formatters ([#1](https://github.com/discordjs/builders/issues/1)) ([765e46d](https://github.com/discordjs/builders/commit/765e46dac96c4e49d350243e5fad34c2bc738a7c))
diff --git a/node_modules/@discordjs/builders/README.md b/node_modules/@discordjs/builders/README.md
index f78d442..d6d8f67 100644
--- a/node_modules/@discordjs/builders/README.md
+++ b/node_modules/@discordjs/builders/README.md
@@ -8,14 +8,14 @@
-
-
+
+
## Installation
-**Node.js 16.6.0 or newer is required.**
+**Node.js 16.9.0 or newer is required.**
```sh-session
npm install @discordjs/builders
@@ -27,17 +27,17 @@ pnpm add @discordjs/builders
Here are some examples for the builders and utilities you can find in this package:
-- [Slash Command Builders](./docs/examples/Slash%20Command%20Builders.md)
+- [Slash Command Builders](https://github.com/discordjs/discord.js/blob/main/packages/builders/docs/examples/Slash%20Command%20Builders.md)
## Links
-- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/website))
+- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/discord.js/tree/main/packages/website))
- [Documentation](https://discord.js.org/#/docs/builders)
- [Guide](https://discordjs.guide/) ([source](https://github.com/discordjs/guide))
See also the [Update Guide](https://discordjs.guide/additional-info/changes-in-v13.html), including updated and removed items in the library.
- [discord.js Discord server](https://discord.gg/djs)
- [Discord API Discord server](https://discord.gg/discord-api)
-- [GitHub](https://github.com/discordjs/builders)
+- [GitHub](https://github.com/discordjs/discord.js/tree/main/packages/builders)
- [npm](https://www.npmjs.com/package/@discordjs/builders)
- [Related libraries](https://discord.com/developers/docs/topics/community-resources#libraries)
@@ -45,7 +45,7 @@ Here are some examples for the builders and utilities you can find in this packa
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
[documentation](https://discord.js.org/#/docs/builders).
-See [the contribution guide](https://github.com/discordjs/builders/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR.
+See [the contribution guide](https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR.
## Help
diff --git a/node_modules/@discordjs/builders/dist/index.d.ts b/node_modules/@discordjs/builders/dist/index.d.ts
index a979649..c8b0571 100644
--- a/node_modules/@discordjs/builders/dist/index.d.ts
+++ b/node_modules/@discordjs/builders/dist/index.d.ts
@@ -1,158 +1,134 @@
-import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
-import { z } from 'zod';
-import { Snowflake } from 'discord-api-types/globals';
+import * as _sapphire_shapeshift from '@sapphire/shapeshift';
+import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIActionRowComponentTypes, APIActionRowComponent, APIBaseComponent, ComponentType, APIButtonComponent, APISelectMenuComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIMessageComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, Permissions, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, Locale, ApplicationCommandType } from 'discord-api-types/v10';
import { URL } from 'url';
+import { Snowflake } from 'discord-api-types/globals';
-declare const fieldNamePredicate: z.ZodString;
-declare const fieldValuePredicate: z.ZodString;
-declare const fieldInlinePredicate: z.ZodOptional;
-declare const embedFieldPredicate: z.ZodObject<{
- name: z.ZodString;
- value: z.ZodString;
- inline: z.ZodOptional;
-}, "strip", z.ZodTypeAny, {
- inline?: boolean | undefined;
+declare const fieldNamePredicate: _sapphire_shapeshift.StringValidator;
+declare const fieldValuePredicate: _sapphire_shapeshift.StringValidator;
+declare const fieldInlinePredicate: _sapphire_shapeshift.UnionValidator;
+declare const embedFieldPredicate: _sapphire_shapeshift.ObjectValidator<{
name: string;
value: string;
-}, {
- inline?: boolean | undefined;
+ inline: boolean | undefined;
+}, _sapphire_shapeshift.UndefinedToOptional<{
name: string;
value: string;
-}>;
-declare const embedFieldsArrayPredicate: z.ZodArray;
-}, "strip", z.ZodTypeAny, {
- inline?: boolean | undefined;
+ inline: boolean | undefined;
+}>>;
+declare const embedFieldsArrayPredicate: _sapphire_shapeshift.ArrayValidator<_sapphire_shapeshift.UndefinedToOptional<{
name: string;
value: string;
-}, {
- inline?: boolean | undefined;
+ inline: boolean | undefined;
+}>[], _sapphire_shapeshift.UndefinedToOptional<{
name: string;
value: string;
-}>, "many">;
-declare const fieldLengthPredicate: z.ZodNumber;
-declare function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void;
-declare const authorNamePredicate: z.ZodNullable;
-declare const urlPredicate: z.ZodNullable>;
-declare const colorPredicate: z.ZodNullable;
-declare const descriptionPredicate: z.ZodNullable;
-declare const footerTextPredicate: z.ZodNullable;
-declare const timestampPredicate: z.ZodNullable>;
-declare const titlePredicate: z.ZodNullable;
+ inline: boolean | undefined;
+}>>;
+declare const fieldLengthPredicate: _sapphire_shapeshift.NumberValidator;
+declare function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void;
+declare const authorNamePredicate: _sapphire_shapeshift.UnionValidator;
+declare const imageURLPredicate: _sapphire_shapeshift.UnionValidator;
+declare const urlPredicate: _sapphire_shapeshift.UnionValidator;
+declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
+ name: string | null;
+ iconURL: string | null | undefined;
+ url: string | null | undefined;
+}, _sapphire_shapeshift.UndefinedToOptional<{
+ name: string | null;
+ iconURL: string | null | undefined;
+ url: string | null | undefined;
+}>>;
+declare const RGBPredicate: _sapphire_shapeshift.NumberValidator;
+declare const colorPredicate: _sapphire_shapeshift.UnionValidator;
+declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator;
+declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator;
+declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
+ text: string | null;
+ iconURL: string | null | undefined;
+}, _sapphire_shapeshift.UndefinedToOptional<{
+ text: string | null;
+ iconURL: string | null | undefined;
+}>>;
+declare const timestampPredicate: _sapphire_shapeshift.UnionValidator;
+declare const titlePredicate: _sapphire_shapeshift.UnionValidator;
-declare const Assertions$2_fieldNamePredicate: typeof fieldNamePredicate;
-declare const Assertions$2_fieldValuePredicate: typeof fieldValuePredicate;
-declare const Assertions$2_fieldInlinePredicate: typeof fieldInlinePredicate;
-declare const Assertions$2_embedFieldPredicate: typeof embedFieldPredicate;
-declare const Assertions$2_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
-declare const Assertions$2_fieldLengthPredicate: typeof fieldLengthPredicate;
-declare const Assertions$2_validateFieldLength: typeof validateFieldLength;
-declare const Assertions$2_authorNamePredicate: typeof authorNamePredicate;
-declare const Assertions$2_urlPredicate: typeof urlPredicate;
-declare const Assertions$2_colorPredicate: typeof colorPredicate;
-declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
-declare const Assertions$2_footerTextPredicate: typeof footerTextPredicate;
-declare const Assertions$2_timestampPredicate: typeof timestampPredicate;
-declare const Assertions$2_titlePredicate: typeof titlePredicate;
-declare namespace Assertions$2 {
+declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate;
+declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate;
+declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate;
+declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate;
+declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
+declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate;
+declare const Assertions$5_validateFieldLength: typeof validateFieldLength;
+declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate;
+declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate;
+declare const Assertions$5_urlPredicate: typeof urlPredicate;
+declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate;
+declare const Assertions$5_RGBPredicate: typeof RGBPredicate;
+declare const Assertions$5_colorPredicate: typeof colorPredicate;
+declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate;
+declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate;
+declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate;
+declare const Assertions$5_timestampPredicate: typeof timestampPredicate;
+declare const Assertions$5_titlePredicate: typeof titlePredicate;
+declare namespace Assertions$5 {
export {
- Assertions$2_fieldNamePredicate as fieldNamePredicate,
- Assertions$2_fieldValuePredicate as fieldValuePredicate,
- Assertions$2_fieldInlinePredicate as fieldInlinePredicate,
- Assertions$2_embedFieldPredicate as embedFieldPredicate,
- Assertions$2_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
- Assertions$2_fieldLengthPredicate as fieldLengthPredicate,
- Assertions$2_validateFieldLength as validateFieldLength,
- Assertions$2_authorNamePredicate as authorNamePredicate,
- Assertions$2_urlPredicate as urlPredicate,
- Assertions$2_colorPredicate as colorPredicate,
- Assertions$2_descriptionPredicate as descriptionPredicate,
- Assertions$2_footerTextPredicate as footerTextPredicate,
- Assertions$2_timestampPredicate as timestampPredicate,
- Assertions$2_titlePredicate as titlePredicate,
+ Assertions$5_fieldNamePredicate as fieldNamePredicate,
+ Assertions$5_fieldValuePredicate as fieldValuePredicate,
+ Assertions$5_fieldInlinePredicate as fieldInlinePredicate,
+ Assertions$5_embedFieldPredicate as embedFieldPredicate,
+ Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
+ Assertions$5_fieldLengthPredicate as fieldLengthPredicate,
+ Assertions$5_validateFieldLength as validateFieldLength,
+ Assertions$5_authorNamePredicate as authorNamePredicate,
+ Assertions$5_imageURLPredicate as imageURLPredicate,
+ Assertions$5_urlPredicate as urlPredicate,
+ Assertions$5_embedAuthorPredicate as embedAuthorPredicate,
+ Assertions$5_RGBPredicate as RGBPredicate,
+ Assertions$5_colorPredicate as colorPredicate,
+ Assertions$5_descriptionPredicate as descriptionPredicate,
+ Assertions$5_footerTextPredicate as footerTextPredicate,
+ Assertions$5_embedFooterPredicate as embedFooterPredicate,
+ Assertions$5_timestampPredicate as timestampPredicate,
+ Assertions$5_titlePredicate as titlePredicate,
};
}
-interface AuthorOptions {
- name: string;
- url?: string;
+declare function normalizeArray(arr: RestOrArray): T[];
+declare type RestOrArray = T[] | [T[]];
+
+declare type RGBTuple = [red: number, green: number, blue: number];
+interface IconData {
+ /**
+ * The URL of the icon
+ */
iconURL?: string;
+ /**
+ * The proxy URL of the icon
+ */
+ proxyIconURL?: string;
}
-interface FooterOptions {
- text: string;
- iconURL?: string;
+declare type EmbedAuthorData = Omit & IconData;
+declare type EmbedAuthorOptions = Omit;
+declare type EmbedFooterData = Omit & IconData;
+declare type EmbedFooterOptions = Omit;
+interface EmbedImageData extends Omit {
+ /**
+ * The proxy URL for the image
+ */
+ proxyURL?: string;
}
/**
- * Represents an embed in a message (image/video preview, rich embed, etc.)
+ * Represents a embed in a message (image/video preview, rich embed, etc.)
*/
-declare class Embed implements APIEmbed {
- /**
- * An array of fields of this embed
- */
- fields: APIEmbedField[];
- /**
- * The embed title
- */
- title?: string;
- /**
- * The embed description
- */
- description?: string;
- /**
- * The embed url
- */
- url?: string;
- /**
- * The embed color
- */
- color?: number;
- /**
- * The timestamp of the embed in the ISO format
- */
- timestamp?: string;
- /**
- * The embed thumbnail data
- */
- thumbnail?: APIEmbedThumbnail;
- /**
- * The embed image data
- */
- image?: APIEmbedImage;
- /**
- * Received video data
- */
- video?: APIEmbedVideo;
- /**
- * The embed author data
- */
- author?: APIEmbedAuthor;
- /**
- * Received data about the embed provider
- */
- provider?: APIEmbedProvider;
- /**
- * The embed footer data
- */
- footer?: APIEmbedFooter;
+declare class EmbedBuilder {
+ readonly data: APIEmbed;
constructor(data?: APIEmbed);
- /**
- * The accumulated length for the embed title, description, fields, footer text, and author name
- */
- get length(): number;
- /**
- * Adds a field to the embed (max 25)
- *
- * @param field The field to add.
- */
- addField(field: APIEmbedField): this;
/**
* Adds fields to the embed (max 25)
*
* @param fields The fields to add
*/
- addFields(...fields: APIEmbedField[]): this;
+ addFields(...fields: RestOrArray): this;
/**
* Removes, replaces, or inserts fields in the embed (max 25)
*
@@ -161,18 +137,23 @@ declare class Embed implements APIEmbed {
* @param fields The replacing field objects
*/
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
+ /**
+ * Sets the embed's fields (max 25).
+ * @param fields The fields to set
+ */
+ setFields(...fields: RestOrArray): this;
/**
* Sets the author of this embed
*
* @param options The options for the author
*/
- setAuthor(options: AuthorOptions | null): this;
+ setAuthor(options: EmbedAuthorOptions | null): this;
/**
* Sets the color of this embed
*
* @param color The color of the embed
*/
- setColor(color: number | null): this;
+ setColor(color: number | RGBTuple | null): this;
/**
* Sets the description of this embed
*
@@ -184,7 +165,7 @@ declare class Embed implements APIEmbed {
*
* @param options The options for the footer
*/
- setFooter(options: FooterOptions | null): this;
+ setFooter(options: EmbedFooterOptions | null): this;
/**
* Sets the image of this embed
*
@@ -219,178 +200,166 @@ declare class Embed implements APIEmbed {
* Transforms the embed to a plain object
*/
toJSON(): APIEmbed;
- /**
- * Normalizes field input and resolves strings
- *
- * @param fields Fields to normalize
- */
- static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[];
}
/**
* Wraps the content inside a codeblock with no language
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function codeBlock(content: C): `\`\`\`\n${C}\`\`\``;
/**
* Wraps the content inside a codeblock with the specified language
*
- * @param language The language for the codeblock
- * @param content The content to wrap
+ * @param language - The language for the codeblock
+ * @param content - The content to wrap
*/
declare function codeBlock(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
/**
* Wraps the content inside \`backticks\`, which formats it as inline code
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function inlineCode(content: C): `\`${C}\``;
/**
* Formats the content into italic text
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function italic(content: C): `_${C}_`;
/**
* Formats the content into bold text
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function bold(content: C): `**${C}**`;
/**
* Formats the content into underscored text
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function underscore(content: C): `__${C}__`;
/**
* Formats the content into strike-through text
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function strikethrough(content: C): `~~${C}~~`;
/**
* Formats the content into a quote. This needs to be at the start of the line for Discord to format it
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function quote(content: C): `> ${C}`;
/**
* Formats the content into a block quote. This needs to be at the start of the line for Discord to format it
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function blockQuote(content: C): `>>> ${C}`;
/**
* Wraps the URL into `<>`, which stops it from embedding
*
- * @param url The URL to wrap
+ * @param url - The URL to wrap
*/
declare function hideLinkEmbed(url: C): `<${C}>`;
/**
* Wraps the URL into `<>`, which stops it from embedding
*
- * @param url The URL to wrap
+ * @param url - The URL to wrap
*/
declare function hideLinkEmbed(url: URL): `<${string}>`;
/**
* Formats the content and the URL into a masked URL
*
- * @param content The content to display
- * @param url The URL the content links to
+ * @param content - The content to display
+ * @param url - The URL the content links to
*/
declare function hyperlink(content: C, url: URL): `[${C}](${string})`;
/**
* Formats the content and the URL into a masked URL
*
- * @param content The content to display
- * @param url The URL the content links to
+ * @param content - The content to display
+ * @param url - The URL the content links to
*/
declare function hyperlink(content: C, url: U): `[${C}](${U})`;
/**
* Formats the content and the URL into a masked URL
*
- * @param content The content to display
- * @param url The URL the content links to
- * @param title The title shown when hovering on the masked link
+ * @param content - The content to display
+ * @param url - The URL the content links to
+ * @param title - The title shown when hovering on the masked link
*/
declare function hyperlink(content: C, url: URL, title: T): `[${C}](${string} "${T}")`;
/**
* Formats the content and the URL into a masked URL
*
- * @param content The content to display
- * @param url The URL the content links to
- * @param title The title shown when hovering on the masked link
+ * @param content - The content to display
+ * @param url - The URL the content links to
+ * @param title - The title shown when hovering on the masked link
*/
declare function hyperlink(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
/**
* Wraps the content inside spoiler (hidden text)
*
- * @param content The content to wrap
+ * @param content - The content to wrap
*/
declare function spoiler(content: C): `||${C}||`;
/**
* Formats a user ID into a user mention
*
- * @param userId The user ID to format
+ * @param userId - The user ID to format
*/
declare function userMention(userId: C): `<@${C}>`;
-/**
- * Formats a user ID into a member-nickname mention
- *
- * @param memberId The user ID to format
- */
-declare function memberNicknameMention(memberId: C): `<@!${C}>`;
/**
* Formats a channel ID into a channel mention
*
- * @param channelId The channel ID to format
+ * @param channelId - The channel ID to format
*/
declare function channelMention(channelId: C): `<#${C}>`;
/**
* Formats a role ID into a role mention
*
- * @param roleId The role ID to format
+ * @param roleId - The role ID to format
*/
declare function roleMention(roleId: C): `<@&${C}>`;
/**
* Formats an emoji ID into a fully qualified emoji identifier
*
- * @param emojiId The emoji ID to format
+ * @param emojiId - The emoji ID to format
*/
declare function formatEmoji(emojiId: C, animated?: false): `<:_:${C}>`;
/**
* Formats an emoji ID into a fully qualified emoji identifier
*
- * @param emojiId The emoji ID to format
- * @param animated Whether the emoji is animated or not. Defaults to `false`
+ * @param emojiId - The emoji ID to format
+ * @param animated - Whether the emoji is animated or not. Defaults to `false`
*/
declare function formatEmoji(emojiId: C, animated?: true): ``;
/**
* Formats a date into a short date-time string
*
- * @param date The date to format, defaults to the current time
+ * @param date - The date to format, defaults to the current time
*/
declare function time(date?: Date): ``;
/**
* Formats a date given a format style
*
- * @param date The date to format
- * @param style The style to use
+ * @param date - The date to format
+ * @param style - The style to use
*/
declare function time(date: Date, style: S): ``;
/**
* Formats the given timestamp into a short date-time string
*
- * @param seconds The time to format, represents an UNIX timestamp in seconds
+ * @param seconds - The time to format, represents an UNIX timestamp in seconds
*/
declare function time(seconds: C): ``;
/**
* Formats the given timestamp into a short date-time string
*
- * @param seconds The time to format, represents an UNIX timestamp in seconds
- * @param style The style to use
+ * @param seconds - The time to format, represents an UNIX timestamp in seconds
+ * @param style - The style to use
*/
declare function time(seconds: C, style: S): ``;
/**
@@ -448,57 +417,513 @@ declare enum Faces {
Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"
}
+/**
+ * Represents a option within a select menu component
+ */
+declare class SelectMenuOptionBuilder {
+ data: Partial;
+ constructor(data?: Partial);
+ /**
+ * Sets the label of this option
+ *
+ * @param label - The label to show on this option
+ */
+ setLabel(label: string): this;
+ /**
+ * Sets the value of this option
+ *
+ * @param value - The value of this option
+ */
+ setValue(value: string): this;
+ /**
+ * Sets the description of this option
+ *
+ * @param description - The description of this option
+ */
+ setDescription(description: string): this;
+ /**
+ * Sets whether this option is selected by default
+ *
+ * @param isDefault - Whether this option is selected by default
+ */
+ setDefault(isDefault?: boolean): this;
+ /**
+ * Sets the emoji to display on this option
+ *
+ * @param emoji - The emoji to display on this option
+ */
+ setEmoji(emoji: APIMessageComponentEmoji): this;
+ toJSON(): APISelectMenuOption;
+}
+
+declare const customIdValidator: _sapphire_shapeshift.StringValidator;
+declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
+ id?: string | undefined;
+ name?: string | undefined;
+ animated?: boolean | undefined;
+}, _sapphire_shapeshift.UndefinedToOptional<{
+ id?: string | undefined;
+ name?: string | undefined;
+ animated?: boolean | undefined;
+}>>;
+declare const disabledValidator: _sapphire_shapeshift.BooleanValidator;
+declare const buttonLabelValidator: _sapphire_shapeshift.StringValidator;
+declare const buttonStyleValidator: _sapphire_shapeshift.NativeEnumValidator;
+declare const placeholderValidator$1: _sapphire_shapeshift.StringValidator;
+declare const minMaxValidator: _sapphire_shapeshift.NumberValidator;
+declare const labelValueDescriptionValidator: _sapphire_shapeshift.StringValidator;
+declare const optionValidator: _sapphire_shapeshift.UnionValidator | undefined;
+ default: boolean | undefined;
+}>>;
+declare const optionsValidator: _sapphire_shapeshift.ArrayValidator<(SelectMenuOptionBuilder | _sapphire_shapeshift.UndefinedToOptional<{
+ label: string;
+ value: string;
+ description: string | undefined;
+ emoji: _sapphire_shapeshift.UndefinedToOptional<{
+ id?: string | undefined;
+ name?: string | undefined;
+ animated?: boolean | undefined;
+ }> | undefined;
+ default: boolean | undefined;
+}>)[], SelectMenuOptionBuilder | _sapphire_shapeshift.UndefinedToOptional<{
+ label: string;
+ value: string;
+ description: string | undefined;
+ emoji: _sapphire_shapeshift.UndefinedToOptional<{
+ id?: string | undefined;
+ name?: string | undefined;
+ animated?: boolean | undefined;
+ }> | undefined;
+ default: boolean | undefined;
+}>>;
+declare const optionsLengthValidator: _sapphire_shapeshift.NumberValidator;
+declare function validateRequiredSelectMenuParameters(options: SelectMenuOptionBuilder[], customId?: string): void;
+declare const defaultValidator: _sapphire_shapeshift.BooleanValidator;
+declare function validateRequiredSelectMenuOptionParameters(label?: string, value?: string): void;
+declare const urlValidator: _sapphire_shapeshift.StringValidator;
+declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, url?: string): void;
+
+declare const Assertions$4_customIdValidator: typeof customIdValidator;
+declare const Assertions$4_emojiValidator: typeof emojiValidator;
+declare const Assertions$4_disabledValidator: typeof disabledValidator;
+declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator;
+declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator;
+declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
+declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
+declare const Assertions$4_optionValidator: typeof optionValidator;
+declare const Assertions$4_optionsValidator: typeof optionsValidator;
+declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator;
+declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
+declare const Assertions$4_defaultValidator: typeof defaultValidator;
+declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
+declare const Assertions$4_urlValidator: typeof urlValidator;
+declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
+declare namespace Assertions$4 {
+ export {
+ Assertions$4_customIdValidator as customIdValidator,
+ Assertions$4_emojiValidator as emojiValidator,
+ Assertions$4_disabledValidator as disabledValidator,
+ Assertions$4_buttonLabelValidator as buttonLabelValidator,
+ Assertions$4_buttonStyleValidator as buttonStyleValidator,
+ placeholderValidator$1 as placeholderValidator,
+ Assertions$4_minMaxValidator as minMaxValidator,
+ Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator,
+ Assertions$4_optionValidator as optionValidator,
+ Assertions$4_optionsValidator as optionsValidator,
+ Assertions$4_optionsLengthValidator as optionsLengthValidator,
+ Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,
+ Assertions$4_defaultValidator as defaultValidator,
+ Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters,
+ Assertions$4_urlValidator as urlValidator,
+ Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters,
+ };
+}
+
+interface JSONEncodable {
+ /**
+ * Transforms this object to its JSON format
+ */
+ toJSON: () => T;
+}
+/**
+ * Indicates if an object is encodable or not.
+ * @param maybeEncodable - The object to check against
+ */
+declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable;
+
+declare type AnyAPIActionRowComponent = APIActionRowComponentTypes | APIActionRowComponent;
+/**
+ * Represents a discord component
+ */
+declare abstract class ComponentBuilder> = APIBaseComponent> implements JSONEncodable {
+ /**
+ * The API data associated with this component
+ */
+ readonly data: Partial;
+ abstract toJSON(): AnyAPIActionRowComponent;
+ constructor(data: Partial);
+}
+
+/**
+ * Represents a button component
+ */
+declare class ButtonBuilder extends ComponentBuilder {
+ constructor(data?: Partial);
+ /**
+ * Sets the style of this button
+ *
+ * @param style - The style of the button
+ */
+ setStyle(style: ButtonStyle): this;
+ /**
+ * Sets the URL for this button
+ *
+ * @param url - The URL to open when this button is clicked
+ */
+ setURL(url: string): this;
+ /**
+ * Sets the custom id for this button
+ *
+ * @param customId - The custom id to use for this button
+ */
+ setCustomId(customId: string): this;
+ /**
+ * Sets the emoji to display on this button
+ *
+ * @param emoji - The emoji to display on this button
+ */
+ setEmoji(emoji: APIMessageComponentEmoji): this;
+ /**
+ * Sets whether this button is disabled
+ *
+ * @param disabled - Whether to disable this button
+ */
+ setDisabled(disabled?: boolean): this;
+ /**
+ * Sets the label for this button
+ *
+ * @param label - The label to display on this button
+ */
+ setLabel(label: string): this;
+ toJSON(): APIButtonComponent;
+}
+
+/**
+ * Represents a select menu component
+ */
+declare class SelectMenuBuilder extends ComponentBuilder {
+ /**
+ * The options within this select menu
+ */
+ readonly options: SelectMenuOptionBuilder[];
+ constructor(data?: Partial);
+ /**
+ * Sets the placeholder for this select menu
+ *
+ * @param placeholder - The placeholder to use for this select menu
+ */
+ setPlaceholder(placeholder: string): this;
+ /**
+ * Sets the minimum values that must be selected in the select menu
+ *
+ * @param minValues - The minimum values that must be selected
+ */
+ setMinValues(minValues: number): this;
+ /**
+ * Sets the maximum values that must be selected in the select menu
+ *
+ * @param maxValues - The maximum values that must be selected
+ */
+ setMaxValues(maxValues: number): this;
+ /**
+ * Sets the custom id for this select menu
+ *
+ * @param customId - The custom id to use for this select menu
+ */
+ setCustomId(customId: string): this;
+ /**
+ * Sets whether this select menu is disabled
+ *
+ * @param disabled - Whether this select menu is disabled
+ */
+ setDisabled(disabled?: boolean): this;
+ /**
+ * Adds options to this select menu
+ *
+ * @param options - The options to add to this select menu
+ * @returns
+ */
+ addOptions(...options: RestOrArray): this;
+ /**
+ * Sets the options on this select menu
+ *
+ * @param options - The options to set on this select menu
+ */
+ setOptions(...options: RestOrArray): this;
+ toJSON(): APISelectMenuComponent;
+}
+
+declare class TextInputBuilder extends ComponentBuilder {
+ constructor(data?: APITextInputComponent & {
+ type?: ComponentType.TextInput;
+ });
+ /**
+ * Sets the custom id for this text input
+ *
+ * @param customId - The custom id of this text input
+ */
+ setCustomId(customId: string): this;
+ /**
+ * Sets the label for this text input
+ *
+ * @param label - The label for this text input
+ */
+ setLabel(label: string): this;
+ /**
+ * Sets the style for this text input
+ *
+ * @param style - The style for this text input
+ */
+ setStyle(style: TextInputStyle): this;
+ /**
+ * Sets the minimum length of text for this text input
+ *
+ * @param minLength - The minimum length of text for this text input
+ */
+ setMinLength(minLength: number): this;
+ /**
+ * Sets the maximum length of text for this text input
+ *
+ * @param maxLength - The maximum length of text for this text input
+ */
+ setMaxLength(maxLength: number): this;
+ /**
+ * Sets the placeholder of this text input
+ *
+ * @param placeholder - The placeholder of this text input
+ */
+ setPlaceholder(placeholder: string): this;
+ /**
+ * Sets the value of this text input
+ *
+ * @param value - The value for this text input
+ */
+ setValue(value: string): this;
+ /**
+ * Sets whether this text input is required
+ *
+ * @param required - Whether this text input is required
+ */
+ setRequired(required?: boolean): this;
+ toJSON(): APITextInputComponent;
+ equals(other: JSONEncodable | APITextInputComponent): boolean;
+}
+
+declare type MessageComponentBuilder = MessageActionRowComponentBuilder | ActionRowBuilder;
+declare type ModalComponentBuilder = ModalActionRowComponentBuilder | ActionRowBuilder;
+declare type MessageActionRowComponentBuilder = ButtonBuilder | SelectMenuBuilder;
+declare type ModalActionRowComponentBuilder = TextInputBuilder;
+declare type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComponentBuilder;
+/**
+ * Represents an action row component
+ */
+declare class ActionRowBuilder extends ComponentBuilder> {
+ /**
+ * The components within this action row
+ */
+ readonly components: T[];
+ constructor({ components, ...data }?: Partial>);
+ /**
+ * Adds components to this action row.
+ *
+ * @param components - The components to add to this action row.
+ */
+ addComponents(...components: RestOrArray): this;
+ /**
+ * Sets the components in this action row
+ *
+ * @param components - The components to set this row to
+ */
+ setComponents(...components: RestOrArray): this;
+ toJSON(): APIActionRowComponent>;
+}
+
+interface MappedComponentTypes {
+ [ComponentType.ActionRow]: ActionRowBuilder;
+ [ComponentType.Button]: ButtonBuilder;
+ [ComponentType.SelectMenu]: SelectMenuBuilder;
+ [ComponentType.TextInput]: TextInputBuilder;
+}
+/**
+ * Factory for creating components from API data
+ *
+ * @param data - The api data to transform to a component class
+ */
+declare function createComponentBuilder(data: (APIMessageComponent | APIModalComponent) & {
+ type: T;
+}): MappedComponentTypes[T];
+declare function createComponentBuilder(data: C): C;
+
+declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator;
+declare const minLengthValidator: _sapphire_shapeshift.NumberValidator;
+declare const maxLengthValidator: _sapphire_shapeshift.NumberValidator;
+declare const requiredValidator: _sapphire_shapeshift.BooleanValidator;
+declare const valueValidator: _sapphire_shapeshift.StringValidator;
+declare const placeholderValidator: _sapphire_shapeshift.StringValidator;
+declare const labelValidator: _sapphire_shapeshift.StringValidator;
+declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
+
+declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator;
+declare const Assertions$3_minLengthValidator: typeof minLengthValidator;
+declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator;
+declare const Assertions$3_requiredValidator: typeof requiredValidator;
+declare const Assertions$3_valueValidator: typeof valueValidator;
+declare const Assertions$3_placeholderValidator: typeof placeholderValidator;
+declare const Assertions$3_labelValidator: typeof labelValidator;
+declare namespace Assertions$3 {
+ export {
+ Assertions$3_textInputStyleValidator as textInputStyleValidator,
+ Assertions$3_minLengthValidator as minLengthValidator,
+ Assertions$3_maxLengthValidator as maxLengthValidator,
+ Assertions$3_requiredValidator as requiredValidator,
+ Assertions$3_valueValidator as valueValidator,
+ Assertions$3_placeholderValidator as placeholderValidator,
+ Assertions$3_labelValidator as labelValidator,
+ validateRequiredParameters$3 as validateRequiredParameters,
+ };
+}
+
+declare class ModalBuilder implements JSONEncodable {
+ readonly data: Partial;
+ readonly components: ActionRowBuilder[];
+ constructor({ components, ...data }?: Partial);
+ /**
+ * Sets the title of the modal
+ *
+ * @param title - The title of the modal
+ */
+ setTitle(title: string): this;
+ /**
+ * Sets the custom id of the modal
+ *
+ * @param customId - The custom id of this modal
+ */
+ setCustomId(customId: string): this;
+ /**
+ * Adds components to this modal
+ *
+ * @param components - The components to add to this modal
+ */
+ addComponents(...components: RestOrArray | APIActionRowComponent>): this;
+ /**
+ * Sets the components in this modal
+ *
+ * @param components - The components to set this modal to
+ */
+ setComponents(...components: RestOrArray>): this;
+ toJSON(): APIModalInteractionResponseCallbackData;
+}
+
+declare const titleValidator: _sapphire_shapeshift.StringValidator;
+declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder, ...ActionRowBuilder[]], ActionRowBuilder>;
+declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder[]): void;
+
+declare const Assertions$2_titleValidator: typeof titleValidator;
+declare const Assertions$2_componentsValidator: typeof componentsValidator;
+declare namespace Assertions$2 {
+ export {
+ Assertions$2_titleValidator as titleValidator,
+ Assertions$2_componentsValidator as componentsValidator,
+ validateRequiredParameters$2 as validateRequiredParameters,
+ };
+}
+
declare class SharedNameAndDescription {
readonly name: string;
+ readonly name_localizations?: LocalizationMap;
readonly description: string;
+ readonly description_localizations?: LocalizationMap;
/**
* Sets the name
*
- * @param name The name
+ * @param name - The name
*/
setName(name: string): this;
/**
* Sets the description
*
- * @param description The description
+ * @param description - The description
*/
setDescription(description: string): this;
+ /**
+ * Sets a name localization
+ *
+ * @param locale - The locale to set a description for
+ * @param localizedName - The localized description for the given locale
+ */
+ setNameLocalization(locale: LocaleString, localizedName: string | null): this;
+ /**
+ * Sets the name localizations
+ *
+ * @param localizedNames - The dictionary of localized descriptions to set
+ */
+ setNameLocalizations(localizedNames: LocalizationMap | null): this;
+ /**
+ * Sets a description localization
+ *
+ * @param locale - The locale to set a description for
+ * @param localizedDescription - The localized description for the given locale
+ */
+ setDescriptionLocalization(locale: LocaleString, localizedDescription: string | null): this;
+ /**
+ * Sets the description localizations
+ *
+ * @param localizedDescriptions - The dictionary of localized descriptions to set
+ */
+ setDescriptionLocalizations(localizedDescriptions: LocalizationMap | null): this;
}
declare abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {
abstract readonly type: ApplicationCommandOptionType;
- readonly required = false;
+ readonly required: boolean;
/**
* Marks the option as required
*
- * @param required If this option should be required
+ * @param required - If this option should be required
*/
setRequired(required: boolean): this;
abstract toJSON(): APIApplicationCommandBasicOption;
protected runRequiredValidations(): void;
}
+declare class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {
+ readonly type: ApplicationCommandOptionType.Attachment;
+ toJSON(): APIApplicationCommandAttachmentOption;
+}
+
declare class SlashCommandBooleanOption extends ApplicationCommandOptionBase {
readonly type: ApplicationCommandOptionType.Boolean;
toJSON(): APIApplicationCommandBooleanOption;
}
-declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.GuildVoice, ChannelType.GuildCategory, ChannelType.GuildNews, ChannelType.GuildStore, ChannelType.GuildNewsThread, ChannelType.GuildPublicThread, ChannelType.GuildPrivateThread, ChannelType.GuildStageVoice];
+declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.GuildVoice, ChannelType.GuildCategory, ChannelType.GuildNews, ChannelType.GuildNewsThread, ChannelType.GuildPublicThread, ChannelType.GuildPrivateThread, ChannelType.GuildStageVoice];
declare type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];
declare class ApplicationCommandOptionChannelTypesMixin {
readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
- /**
- * Adds a channel type to this option
- *
- * @param channelType The type of channel to allow
- */
- addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes): this;
/**
* Adds channel types to this option
*
- * @param channelTypes The channel types to add
+ * @param channelTypes - The channel types to add
*/
- addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
+ addChannelTypes(...channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
}
declare class SlashCommandChannelOption extends ApplicationCommandOptionBase {
@@ -509,16 +934,18 @@ interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypes
}
declare abstract class ApplicationCommandNumericOptionMinMaxValueMixin {
- protected readonly maxValue?: number;
- protected readonly minValue?: number;
+ readonly max_value?: number;
+ readonly min_value?: number;
/**
* Sets the maximum number value of this option
- * @param max The maximum value this option can be
+ *
+ * @param max - The maximum value this option can be
*/
abstract setMaxValue(max: number): this;
/**
* Sets the minimum number value of this option
- * @param min The minimum value this option can be
+ *
+ * @param min - The minimum value this option can be
*/
abstract setMinValue(min: number): this;
}
@@ -527,25 +954,18 @@ declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin[];
readonly autocomplete?: boolean;
readonly type: ApplicationCommandOptionType;
- /**
- * Adds a choice for this option
- *
- * @param name The name of the choice
- * @param value The value of the choice
- */
- addChoice(name: string, value: T): Omit;
/**
* Adds multiple choices for this option
*
- * @param choices The choices to add
+ * @param choices - The choices to add
*/
- addChoices(choices: [name: string, value: T][]): Omit;
- setChoices(choices: Input): Input extends [] ? this & Pick, 'setAutocomplete'> : Omit;
+ addChoices(...choices: APIApplicationCommandOptionChoice[]): this;
+ setChoices[]>(...choices: Input): this;
/**
* Marks the option as autocompletable
- * @param autocomplete If this option should be autocompletable
+ * @param autocomplete - If this option should be autocompletable
*/
- setAutocomplete(autocomplete: U): U extends true ? Omit : this & Pick, 'addChoice' | 'addChoices'>;
+ setAutocomplete(autocomplete: boolean): this;
}
declare class SlashCommandIntegerOption extends ApplicationCommandOptionBase implements ApplicationCommandNumericOptionMinMaxValueMixin {
@@ -578,6 +998,20 @@ declare class SlashCommandRoleOption extends ApplicationCommandOptionBase {
declare class SlashCommandStringOption extends ApplicationCommandOptionBase {
readonly type: ApplicationCommandOptionType.String;
+ readonly max_length?: number;
+ readonly min_length?: number;
+ /**
+ * Sets the maximum length of this string option.
+ *
+ * @param max - The maximum length this option can be
+ */
+ setMaxLength(max: number): this;
+ /**
+ * Sets the minimum length of this string option.
+ *
+ * @param min - The minimum length this option can be
+ */
+ setMinLength(min: number): this;
toJSON(): APIApplicationCommandStringOption;
}
interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin {
@@ -593,58 +1027,64 @@ declare class SharedSlashCommandOptions {
/**
* Adds a boolean option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a user option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a channel option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a role option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
+ /**
+ * Adds an attachment option
+ *
+ * @param input - A function that returns an option builder, or an already built builder
+ */
+ addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a mentionable option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a string option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
- addStringOption(input: SlashCommandStringOption | Omit | Omit | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
+ addStringOption(input: SlashCommandStringOption | Omit | Omit | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds an integer option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
- addIntegerOption(input: SlashCommandIntegerOption | Omit | Omit | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
+ addIntegerOption(input: SlashCommandIntegerOption | Omit | Omit | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
/**
* Adds a number option
*
- * @param input A function that returns an option builder, or an already built builder
+ * @param input - A function that returns an option builder, or an already built builder
*/
- addNumberOption(input: SlashCommandNumberOption | Omit | Omit | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
+ addNumberOption(input: SlashCommandNumberOption | Omit | Omit | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit | Omit)): ShouldOmitSubcommandFunctions extends true ? Omit : this;
private _sharedAddOptionMethod;
}
/**
* Represents a folder for subcommands
*
- * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
+ * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
*/
declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
/**
@@ -662,7 +1102,7 @@ declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationComm
/**
* Adds a new subcommand to this group
*
- * @param input A function that returns a subcommand builder, or an already built builder
+ * @param input - A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
toJSON(): APIApplicationCommandSubcommandGroupOption;
@@ -672,7 +1112,7 @@ interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
/**
* Represents a subcommand
*
- * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
+ * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
*/
declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
/**
@@ -697,10 +1137,18 @@ declare class SlashCommandBuilder {
* The name of this slash command
*/
readonly name: string;
+ /**
+ * The localized names for this command
+ */
+ readonly name_localizations?: LocalizationMap;
/**
* The description of this slash command
*/
readonly description: string;
+ /**
+ * The localized descriptions for this command
+ */
+ readonly description_localizations?: LocalizationMap;
/**
* The options of this slash command
*/
@@ -708,9 +1156,19 @@ declare class SlashCommandBuilder {
/**
* Whether the command is enabled by default when the app is added to a guild
*
- * @default true
+ * @deprecated This property is deprecated and will be removed in the future.
+ * You should use `setDefaultMemberPermissions` or `setDMPermission` instead.
*/
- readonly defaultPermission: boolean | undefined;
+ readonly default_permission: boolean | undefined;
+ /**
+ * Set of permissions represented as a bit set for the command
+ */
+ readonly default_member_permissions: Permissions | null | undefined;
+ /**
+ * Indicates whether the command is available in DMs with the application, only for globally-scoped commands.
+ * By default, commands are visible.
+ */
+ readonly dm_permission: boolean | undefined;
/**
* Returns the final data that should be sent to Discord.
*
@@ -722,21 +1180,41 @@ declare class SlashCommandBuilder {
*
* **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
*
- * @param value Whether or not to enable this command by default
+ * @param value - Whether or not to enable this command by default
*
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
+ * @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
*/
setDefaultPermission(value: boolean): this;
+ /**
+ * Sets the default permissions a member should have in order to run the command.
+ *
+ * **Note:** You can set this to `'0'` to disable the command by default.
+ *
+ * @param permissions - The permissions bit field to set
+ *
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
+ */
+ setDefaultMemberPermissions(permissions: Permissions | bigint | number | null | undefined): this;
+ /**
+ * Sets if the command is available in DMs with the application, only for globally-scoped commands.
+ * By default, commands are visible.
+ *
+ * @param enabled - If the command should be enabled in DMs
+ *
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
+ */
+ setDMPermission(enabled: boolean | null | undefined): this;
/**
* Adds a new subcommand group to this command
*
- * @param input A function that returns a subcommand group builder, or an already built builder
+ * @param input - A function that returns a subcommand group builder, or an already built builder
*/
addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
/**
* Adds a new subcommand to this command
*
- * @param input A function that returns a subcommand builder, or an already built builder
+ * @param input - A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
}
@@ -747,33 +1225,46 @@ interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, P
interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick {
}
interface ToAPIApplicationCommandOptions {
- toJSON(): APIApplicationCommandOption;
+ toJSON: () => APIApplicationCommandOption;
}
-declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
declare function validateName$1(name: unknown): asserts name is string;
declare function validateDescription(description: unknown): asserts description is string;
+declare function validateLocale(locale: unknown): Locale;
+declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
+declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
declare function validateRequired(required: unknown): asserts required is boolean;
-declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
-declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
+declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
declare function assertReturnOfBuilder(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
+declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional>> | null | undefined>;
+declare function validateLocalizationMap(value: unknown): asserts value is LocalizationMap;
+declare function validateDMPermission$1(value: unknown): asserts value is boolean | null | undefined;
+declare function validateDefaultMemberPermissions$1(permissions: unknown): string | null | undefined;
declare const Assertions$1_validateDescription: typeof validateDescription;
-declare const Assertions$1_validateRequired: typeof validateRequired;
+declare const Assertions$1_validateLocale: typeof validateLocale;
declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
-declare const Assertions$1_validateMaxChoicesLength: typeof validateMaxChoicesLength;
+declare const Assertions$1_validateRequired: typeof validateRequired;
+declare const Assertions$1_validateChoicesLength: typeof validateChoicesLength;
declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
+declare const Assertions$1_localizationMapPredicate: typeof localizationMapPredicate;
+declare const Assertions$1_validateLocalizationMap: typeof validateLocalizationMap;
declare namespace Assertions$1 {
export {
- validateRequiredParameters$1 as validateRequiredParameters,
validateName$1 as validateName,
Assertions$1_validateDescription as validateDescription,
+ Assertions$1_validateLocale as validateLocale,
+ Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
+ validateRequiredParameters$1 as validateRequiredParameters,
validateDefaultPermission$1 as validateDefaultPermission,
Assertions$1_validateRequired as validateRequired,
- Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
- Assertions$1_validateMaxChoicesLength as validateMaxChoicesLength,
+ Assertions$1_validateChoicesLength as validateChoicesLength,
Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
+ Assertions$1_localizationMapPredicate as localizationMapPredicate,
+ Assertions$1_validateLocalizationMap as validateLocalizationMap,
+ validateDMPermission$1 as validateDMPermission,
+ validateDefaultMemberPermissions$1 as validateDefaultMemberPermissions,
};
}
@@ -782,6 +1273,10 @@ declare class ContextMenuCommandBuilder {
* The name of this context menu command
*/
readonly name: string;
+ /**
+ * The localized names for this command
+ */
+ readonly name_localizations?: LocalizationMap;
/**
* The type of this context menu command
*/
@@ -789,19 +1284,29 @@ declare class ContextMenuCommandBuilder {
/**
* Whether the command is enabled by default when the app is added to a guild
*
- * @default true
+ * @deprecated This property is deprecated and will be removed in the future.
+ * You should use `setDefaultMemberPermissions` or `setDMPermission` instead.
*/
- readonly defaultPermission: boolean | undefined;
+ readonly default_permission: boolean | undefined;
+ /**
+ * Set of permissions represented as a bit set for the command
+ */
+ readonly default_member_permissions: Permissions | null | undefined;
+ /**
+ * Indicates whether the command is available in DMs with the application, only for globally-scoped commands.
+ * By default, commands are visible.
+ */
+ readonly dm_permission: boolean | undefined;
/**
* Sets the name
*
- * @param name The name
+ * @param name - The name
*/
setName(name: string): this;
/**
* Sets the type
*
- * @param type The type
+ * @param type - The type
*/
setType(type: ContextMenuCommandType): this;
/**
@@ -809,11 +1314,44 @@ declare class ContextMenuCommandBuilder {
*
* **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
*
- * @param value Whether or not to enable this command by default
+ * @param value - Whether or not to enable this command by default
+ *
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
+ * @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
+ */
+ setDefaultPermission(value: boolean): this;
+ /**
+ * Sets the default permissions a member should have in order to run the command.
+ *
+ * **Note:** You can set this to `'0'` to disable the command by default.
+ *
+ * @param permissions - The permissions bit field to set
*
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
*/
- setDefaultPermission(value: boolean): this;
+ setDefaultMemberPermissions(permissions: Permissions | bigint | number | null | undefined): this;
+ /**
+ * Sets if the command is available in DMs with the application, only for globally-scoped commands.
+ * By default, commands are visible.
+ *
+ * @param enabled - If the command should be enabled in DMs
+ *
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
+ */
+ setDMPermission(enabled: boolean | null | undefined): this;
+ /**
+ * Sets a name localization
+ *
+ * @param locale - The locale to set a description for
+ * @param localizedName - The localized description for the given locale
+ */
+ setNameLocalization(locale: LocaleString, localizedName: string | null): this;
+ /**
+ * Sets the name localizations
+ *
+ * @param localizedNames - The dictionary of localized descriptions to set
+ */
+ setNameLocalizations(localizedNames: LocalizationMap | null): this;
/**
* Returns the final data that should be sent to Discord.
*
@@ -823,22 +1361,46 @@ declare class ContextMenuCommandBuilder {
}
declare type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;
-declare function validateRequiredParameters(name: string, type: number): void;
+declare function validateDefaultPermission(value: unknown): asserts value is boolean;
declare function validateName(name: unknown): asserts name is string;
declare function validateType(type: unknown): asserts type is ContextMenuCommandType;
-declare function validateDefaultPermission(value: unknown): asserts value is boolean;
+declare function validateRequiredParameters(name: string, type: number): void;
+declare function validateDMPermission(value: unknown): asserts value is boolean | null | undefined;
+declare function validateDefaultMemberPermissions(permissions: unknown): string | null | undefined;
-declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
+declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
declare const Assertions_validateName: typeof validateName;
declare const Assertions_validateType: typeof validateType;
-declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
+declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
+declare const Assertions_validateDMPermission: typeof validateDMPermission;
+declare const Assertions_validateDefaultMemberPermissions: typeof validateDefaultMemberPermissions;
declare namespace Assertions {
export {
- Assertions_validateRequiredParameters as validateRequiredParameters,
+ Assertions_validateDefaultPermission as validateDefaultPermission,
Assertions_validateName as validateName,
Assertions_validateType as validateType,
- Assertions_validateDefaultPermission as validateDefaultPermission,
+ Assertions_validateRequiredParameters as validateRequiredParameters,
+ Assertions_validateDMPermission as validateDMPermission,
+ Assertions_validateDefaultMemberPermissions as validateDefaultMemberPermissions,
};
}
-export { AuthorOptions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$2 as EmbedAssertions, Faces, FooterOptions, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, memberNicknameMention, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };
+interface Equatable {
+ /**
+ * Whether or not this is equal to another structure
+ */
+ equals: (other: T) => boolean;
+}
+/**
+ * Indicates if an object is equatable or not.
+ * @param maybeEquatable - The object to check against
+ */
+declare function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable;
+
+declare function embedLength(data: APIEmbed): number;
+
+declare const enableValidators: () => boolean;
+declare const disableValidators: () => boolean;
+declare const isValidationEnabled: () => boolean;
+
+export { ActionRowBuilder, AnyAPIActionRowComponent, AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin, ButtonBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Assertions$5 as EmbedAssertions, EmbedAuthorData, EmbedAuthorOptions, EmbedBuilder, EmbedFooterData, EmbedFooterOptions, EmbedImageData, Equatable, Faces, IconData, JSONEncodable, MappedComponentTypes, MessageActionRowComponentBuilder, MessageComponentBuilder, ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, ModalComponentBuilder, RGBTuple, RestOrArray, SelectMenuBuilder, SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommandOptions, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, Assertions$3 as TextInputAssertions, TextInputBuilder, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, createComponentBuilder, disableValidators, embedLength, enableValidators, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, isEquatable, isJSONEncodable, isValidationEnabled, italic, normalizeArray, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };
diff --git a/node_modules/@discordjs/builders/dist/index.js b/node_modules/@discordjs/builders/dist/index.js
index e80bb03..11dc178 100644
--- a/node_modules/@discordjs/builders/dist/index.js
+++ b/node_modules/@discordjs/builders/dist/index.js
@@ -1,4 +1,1557 @@
-var Ge=Object.create;var O=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var ze=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var je=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ce=t=>O(t,"__esModule",{value:!0});var w=(t,e)=>{for(var i in e)O(t,i,{get:e[i],enumerable:!0})},fe=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!We.call(t,r)&&(i||r!=="default")&&O(t,r,{get:()=>e[r],enumerable:!(o=he(e,r))||o.enumerable});return t},Ze=(t,e)=>fe(Ce(O(t!=null?Ge(ze(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Ke=(t=>(e,i)=>t&&t.get(e)||(i=fe(Ce({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0),p=(t,e,i,o)=>{for(var r=o>1?void 0:o?he(e,i):e,A=t.length-1,R;A>=0;A--)(R=t[A])&&(r=(o?R(e,i,r):R(r))||r);return o&&r&&O(e,i,r),r};var n=(t,e,i)=>(je(t,typeof e!="symbol"?e+"":e,i),i);var yt={};w(yt,{ContextMenuCommandAssertions:()=>ue,ContextMenuCommandBuilder:()=>Je,Embed:()=>M,EmbedAssertions:()=>ie,Faces:()=>Ae,SlashCommandAssertions:()=>re,SlashCommandBooleanOption:()=>J,SlashCommandBuilder:()=>j,SlashCommandChannelOption:()=>y,SlashCommandIntegerOption:()=>P,SlashCommandMentionableOption:()=>q,SlashCommandNumberOption:()=>T,SlashCommandRoleOption:()=>z,SlashCommandStringOption:()=>I,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>x,SlashCommandUserOption:()=>W,TimestampStyles:()=>ut,blockQuote:()=>nt,bold:()=>Ye,channelMention:()=>mt,codeBlock:()=>Qe,formatEmoji:()=>dt,hideLinkEmbed:()=>ot,hyperlink:()=>rt,inlineCode:()=>He,italic:()=>Xe,memberNicknameMention:()=>pt,quote:()=>it,roleMention:()=>lt,spoiler:()=>at,strikethrough:()=>tt,time:()=>ct,underscore:()=>et,userMention:()=>st});var ie={};w(ie,{authorNamePredicate:()=>Q,colorPredicate:()=>H,descriptionPredicate:()=>X,embedFieldPredicate:()=>be,embedFieldsArrayPredicate:()=>_,fieldInlinePredicate:()=>k,fieldLengthPredicate:()=>xe,fieldNamePredicate:()=>S,fieldValuePredicate:()=>E,footerTextPredicate:()=>Y,timestampPredicate:()=>ee,titlePredicate:()=>te,urlPredicate:()=>u,validateFieldLength:()=>L});var m=require("zod"),S=m.z.string().min(1).max(256),E=m.z.string().min(1).max(1024),k=m.z.boolean().optional(),be=m.z.object({name:S,value:E,inline:k}),_=be.array(),xe=m.z.number().lte(25);function L(t,e){xe.parse(t.length+e)}var Q=S.nullable(),u=m.z.string().url().nullish(),H=m.z.number().gte(0).lte(16777215).nullable(),X=m.z.string().min(1).max(4096).nullable(),Y=m.z.string().min(1).max(2048).nullable(),ee=m.z.union([m.z.number(),m.z.date()]).nullable(),te=S.nullable();var M=class{constructor(e={}){n(this,"fields");n(this,"title");n(this,"description");n(this,"url");n(this,"color");n(this,"timestamp");n(this,"thumbnail");n(this,"image");n(this,"video");n(this,"author");n(this,"provider");n(this,"footer");this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.thumbnail=e.thumbnail,this.image=e.image,this.video=e.video,this.author=e.author,this.provider=e.provider,this.footer=e.footer,this.fields=e.fields??[],e.timestamp&&(this.timestamp=new Date(e.timestamp).toISOString())}get length(){return(this.title?.length??0)+(this.description?.length??0)+this.fields.reduce((e,i)=>e+i.name.length+i.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return _.parse(e),L(this.fields,e.length),this.fields.push(...M.normalizeFields(...e)),this}spliceFields(e,i,...o){return _.parse(o),L(this.fields,o.length-i),this.fields.splice(e,i,...M.normalizeFields(...o)),this}setAuthor(e){if(e===null)return this.author=void 0,this;let{name:i,iconURL:o,url:r}=e;return Q.parse(i),u.parse(o),u.parse(r),this.author={name:i,url:r,icon_url:o},this}setColor(e){return H.parse(e),this.color=e??void 0,this}setDescription(e){return X.parse(e),this.description=e??void 0,this}setFooter(e){if(e===null)return this.footer=void 0,this;let{text:i,iconURL:o}=e;return Y.parse(i),u.parse(o),this.footer={text:i,icon_url:o},this}setImage(e){return u.parse(e),this.image=e?{url:e}:void 0,this}setThumbnail(e){return u.parse(e),this.thumbnail=e?{url:e}:void 0,this}setTimestamp(e=Date.now()){return ee.parse(e),this.timestamp=e?new Date(e).toISOString():void 0,this}setTitle(e){return te.parse(e),this.title=e??void 0,this}setURL(e){return u.parse(e),this.url=e??void 0,this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(i=>(S.parse(i.name),E.parse(i.value),k.parse(i.inline),{name:i.name,value:i.value,inline:i.inline??void 0}))}};function Qe(t,e){return typeof e=="undefined"?`\`\`\`
-${t}\`\`\``:`\`\`\`${t}
-${e}\`\`\``}function He(t){return`\`${t}\``}function Xe(t){return`_${t}_`}function Ye(t){return`**${t}**`}function et(t){return`__${t}__`}function tt(t){return`~~${t}~~`}function it(t){return`> ${t}`}function nt(t){return`>>> ${t}`}function ot(t){return`<${t}>`}function rt(t,e,i){return i?`[${t}](${e} "${i}")`:`[${t}](${e})`}function at(t){return`||${t}||`}function st(t){return`<@${t}>`}function pt(t){return`<@!${t}>`}function mt(t){return`<#${t}>`}function lt(t){return`<@&${t}>`}function dt(t,e=!1){return`<${e?"a":""}:_:${t}>`}function ct(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?``:``}var ut={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ae=(o=>(o.Shrug="\xAF\\_(\u30C4)\\_/\xAF",o.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",o.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",o))(Ae||{});var re={};w(re,{assertReturnOfBuilder:()=>C,validateDefaultPermission:()=>ne,validateDescription:()=>D,validateMaxChoicesLength:()=>oe,validateMaxOptionsLength:()=>d,validateName:()=>U,validateRequired:()=>F,validateRequiredParameters:()=>h});var V=Ze(require("@sindresorhus/is")),v=require("zod");function h(t,e,i){U(t),D(e),d(i)}var ht=v.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function U(t){ht.parse(t)}var Ct=v.z.string().min(1).max(100);function D(t){Ct.parse(t)}var Oe=v.z.boolean();function ne(t){Oe.parse(t)}function F(t){Oe.parse(t)}var Se=v.z.unknown().array().max(25);function d(t){Se.parse(t)}function oe(t){Se.parse(t)}function C(t,e){let i=e.name;if(V.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${i} builder, got ${t===null?"null":"undefined"} instead.`);if(V.default.primitive(t))throw new TypeError(`Expected to receive a ${i} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let o=t,r=V.default.function_(t)?t.name:o.constructor.name,A=Reflect.get(o,Symbol.toStringTag),R=A?`${r} [${A}]`:r;throw new TypeError(`Expected to receive a ${i} builder, got ${R} instead.`)}}var Fe=require("ts-mixer");var ye=require("discord-api-types/v9");var f=class{constructor(){n(this,"name");n(this,"description")}setName(e){return U(e),Reflect.set(this,"name",e),this}setDescription(e){return D(e),Reflect.set(this,"description",e),this}};var s=class extends f{constructor(){super(...arguments);n(this,"required",!1)}setRequired(e){return F(e),Reflect.set(this,"required",e),this}runRequiredValidations(){h(this.name,this.description,[]),F(this.required)}};var J=class extends s{constructor(){super(...arguments);n(this,"type",ye.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};var ge=require("discord-api-types/v9"),Pe=require("ts-mixer");var l=require("discord-api-types/v9"),ae=require("zod"),ft=[l.ChannelType.GuildText,l.ChannelType.GuildVoice,l.ChannelType.GuildCategory,l.ChannelType.GuildNews,l.ChannelType.GuildStore,l.ChannelType.GuildNewsThread,l.ChannelType.GuildPublicThread,l.ChannelType.GuildPrivateThread,l.ChannelType.GuildStageVoice],bt=ae.z.union(ft.map(t=>ae.z.literal(t))),se=class{constructor(){n(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),bt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(i=>this.addChannelType(i)),this}};var y=class extends s{constructor(){super(...arguments);n(this,"type",ge.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};y=p([(0,Pe.mix)(se)],y);var Re=require("discord-api-types/v9"),Me=require("ts-mixer"),ve=require("zod");var N=class{constructor(){n(this,"maxValue");n(this,"minValue")}};var Te=require("discord-api-types/v9"),g=require("zod");var G=g.z.string().min(1).max(100),Ie=g.z.number().gt(-1/0).lt(1/0),$e=g.z.tuple([G,g.z.union([G,Ie])]).array(),xt=g.z.boolean(),b=class{constructor(){n(this,"choices");n(this,"autocomplete");n(this,"type")}addChoice(e,i){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),oe(this.choices),G.parse(e),this.type===Te.ApplicationCommandOptionType.String?G.parse(i):Ie.parse(i),this.choices.push({name:e,value:i}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e);for(let[i,o]of e)this.addChoice(i,o);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e),Reflect.set(this,"choices",[]);for(let[i,o]of e)this.addChoice(i,o);return this}setAutocomplete(e){if(xt.parse(e),e&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",e),this}};var Ne=ve.z.number().int().nonnegative(),P=class extends s{constructor(){super(...arguments);n(this,"type",Re.ApplicationCommandOptionType.Integer)}setMaxValue(e){return Ne.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return Ne.parse(e),Reflect.set(this,"minValue",e),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};P=p([(0,Me.mix)(N,b)],P);var Be=require("discord-api-types/v9");var q=class extends s{constructor(){super(...arguments);n(this,"type",Be.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};var we=require("discord-api-types/v9"),Ee=require("ts-mixer"),ke=require("zod");var _e=ke.z.number().nonnegative(),T=class extends s{constructor(){super(...arguments);n(this,"type",we.ApplicationCommandOptionType.Number)}setMaxValue(e){return _e.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return _e.parse(e),Reflect.set(this,"minValue",e),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};T=p([(0,Ee.mix)(N,b)],T);var Le=require("discord-api-types/v9");var z=class extends s{constructor(){super(...arguments);n(this,"type",Le.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};var Ve=require("discord-api-types/v9"),Ue=require("ts-mixer");var I=class extends s{constructor(){super(...arguments);n(this,"type",Ve.ApplicationCommandOptionType.String)}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};I=p([(0,Ue.mix)(b)],I);var De=require("discord-api-types/v9");var W=class extends s{constructor(){super(...arguments);n(this,"type",De.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};var B=class{constructor(){n(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,J)}addUserOption(e){return this._sharedAddOptionMethod(e,W)}addChannelOption(e){return this._sharedAddOptionMethod(e,y)}addRoleOption(e){return this._sharedAddOptionMethod(e,z)}addMentionableOption(e){return this._sharedAddOptionMethod(e,q)}addStringOption(e){return this._sharedAddOptionMethod(e,I)}addIntegerOption(e){return this._sharedAddOptionMethod(e,P)}addNumberOption(e){return this._sharedAddOptionMethod(e,T)}_sharedAddOptionMethod(e,i){let{options:o}=this;d(o);let r=typeof e=="function"?e(new i):e;return C(r,i),o.push(r),this}};var pe=require("discord-api-types/v9"),me=require("ts-mixer");var x=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};x=p([(0,me.mix)(f)],x);var c=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};c=p([(0,me.mix)(f,B)],c);var j=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[]);n(this,"defaultPermission")}toJSON(){return h(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(e=>e.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(e){return ne(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new x):e;return C(o,x),i.push(o),this}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}};j=p([(0,Fe.mix)(B,f)],j);var ue={};w(ue,{validateDefaultPermission:()=>ce,validateName:()=>Z,validateRequiredParameters:()=>de,validateType:()=>K});var $=require("zod"),le=require("discord-api-types/v9");function de(t,e){Z(t),K(e)}var At=$.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u);function Z(t){At.parse(t)}var Ot=$.z.union([$.z.literal(le.ApplicationCommandType.User),$.z.literal(le.ApplicationCommandType.Message)]);function K(t){Ot.parse(t)}var St=$.z.boolean();function ce(t){St.parse(t)}var Je=class{constructor(){n(this,"name");n(this,"type");n(this,"defaultPermission")}setName(e){return Z(e),Reflect.set(this,"name",e),this}setType(e){return K(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return ce(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return de(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};module.exports=Ke(yt);0&&(module.exports={ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SlashCommandAssertions,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,blockQuote,bold,channelMention,codeBlock,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
+"use strict";
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var __decorateClass = (decorators, target, key, kind) => {
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
+ if (decorator = decorators[i])
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
+ if (kind && result)
+ __defProp(target, key, result);
+ return result;
+};
+var __publicField = (obj, key, value) => {
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
+ return value;
+};
+
+// src/index.ts
+var src_exports = {};
+__export(src_exports, {
+ ActionRowBuilder: () => ActionRowBuilder,
+ ApplicationCommandNumericOptionMinMaxValueMixin: () => ApplicationCommandNumericOptionMinMaxValueMixin,
+ ApplicationCommandOptionBase: () => ApplicationCommandOptionBase,
+ ApplicationCommandOptionChannelTypesMixin: () => ApplicationCommandOptionChannelTypesMixin,
+ ApplicationCommandOptionWithChoicesAndAutocompleteMixin: () => ApplicationCommandOptionWithChoicesAndAutocompleteMixin,
+ ButtonBuilder: () => ButtonBuilder,
+ ComponentAssertions: () => Assertions_exports2,
+ ComponentBuilder: () => ComponentBuilder,
+ ContextMenuCommandAssertions: () => Assertions_exports6,
+ ContextMenuCommandBuilder: () => ContextMenuCommandBuilder,
+ EmbedAssertions: () => Assertions_exports,
+ EmbedBuilder: () => EmbedBuilder,
+ Faces: () => Faces,
+ ModalAssertions: () => Assertions_exports4,
+ ModalBuilder: () => ModalBuilder,
+ SelectMenuBuilder: () => SelectMenuBuilder,
+ SelectMenuOptionBuilder: () => SelectMenuOptionBuilder,
+ SharedNameAndDescription: () => SharedNameAndDescription,
+ SharedSlashCommandOptions: () => SharedSlashCommandOptions,
+ SlashCommandAssertions: () => Assertions_exports5,
+ SlashCommandAttachmentOption: () => SlashCommandAttachmentOption,
+ SlashCommandBooleanOption: () => SlashCommandBooleanOption,
+ SlashCommandBuilder: () => SlashCommandBuilder,
+ SlashCommandChannelOption: () => SlashCommandChannelOption,
+ SlashCommandIntegerOption: () => SlashCommandIntegerOption,
+ SlashCommandMentionableOption: () => SlashCommandMentionableOption,
+ SlashCommandNumberOption: () => SlashCommandNumberOption,
+ SlashCommandRoleOption: () => SlashCommandRoleOption,
+ SlashCommandStringOption: () => SlashCommandStringOption,
+ SlashCommandSubcommandBuilder: () => SlashCommandSubcommandBuilder,
+ SlashCommandSubcommandGroupBuilder: () => SlashCommandSubcommandGroupBuilder,
+ SlashCommandUserOption: () => SlashCommandUserOption,
+ TextInputAssertions: () => Assertions_exports3,
+ TextInputBuilder: () => TextInputBuilder,
+ TimestampStyles: () => TimestampStyles,
+ blockQuote: () => blockQuote,
+ bold: () => bold,
+ channelMention: () => channelMention,
+ codeBlock: () => codeBlock,
+ createComponentBuilder: () => createComponentBuilder,
+ disableValidators: () => disableValidators,
+ embedLength: () => embedLength,
+ enableValidators: () => enableValidators,
+ formatEmoji: () => formatEmoji,
+ hideLinkEmbed: () => hideLinkEmbed,
+ hyperlink: () => hyperlink,
+ inlineCode: () => inlineCode,
+ isEquatable: () => isEquatable,
+ isJSONEncodable: () => isJSONEncodable,
+ isValidationEnabled: () => isValidationEnabled,
+ italic: () => italic,
+ normalizeArray: () => normalizeArray,
+ quote: () => quote,
+ roleMention: () => roleMention,
+ spoiler: () => spoiler,
+ strikethrough: () => strikethrough,
+ time: () => time,
+ underscore: () => underscore,
+ userMention: () => userMention
+});
+module.exports = __toCommonJS(src_exports);
+
+// src/messages/embed/Assertions.ts
+var Assertions_exports = {};
+__export(Assertions_exports, {
+ RGBPredicate: () => RGBPredicate,
+ authorNamePredicate: () => authorNamePredicate,
+ colorPredicate: () => colorPredicate,
+ descriptionPredicate: () => descriptionPredicate,
+ embedAuthorPredicate: () => embedAuthorPredicate,
+ embedFieldPredicate: () => embedFieldPredicate,
+ embedFieldsArrayPredicate: () => embedFieldsArrayPredicate,
+ embedFooterPredicate: () => embedFooterPredicate,
+ fieldInlinePredicate: () => fieldInlinePredicate,
+ fieldLengthPredicate: () => fieldLengthPredicate,
+ fieldNamePredicate: () => fieldNamePredicate,
+ fieldValuePredicate: () => fieldValuePredicate,
+ footerTextPredicate: () => footerTextPredicate,
+ imageURLPredicate: () => imageURLPredicate,
+ timestampPredicate: () => timestampPredicate,
+ titlePredicate: () => titlePredicate,
+ urlPredicate: () => urlPredicate,
+ validateFieldLength: () => validateFieldLength
+});
+var import_shapeshift = require("@sapphire/shapeshift");
+
+// src/util/validation.ts
+var validate = true;
+var enableValidators = /* @__PURE__ */ __name(() => validate = true, "enableValidators");
+var disableValidators = /* @__PURE__ */ __name(() => validate = false, "disableValidators");
+var isValidationEnabled = /* @__PURE__ */ __name(() => validate, "isValidationEnabled");
+
+// src/messages/embed/Assertions.ts
+var fieldNamePredicate = import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(256).setValidationEnabled(isValidationEnabled);
+var fieldValuePredicate = import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(1024).setValidationEnabled(isValidationEnabled);
+var fieldInlinePredicate = import_shapeshift.s.boolean.optional;
+var embedFieldPredicate = import_shapeshift.s.object({
+ name: fieldNamePredicate,
+ value: fieldValuePredicate,
+ inline: fieldInlinePredicate
+}).setValidationEnabled(isValidationEnabled);
+var embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(isValidationEnabled);
+var fieldLengthPredicate = import_shapeshift.s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
+function validateFieldLength(amountAdding, fields) {
+ fieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);
+}
+__name(validateFieldLength, "validateFieldLength");
+var authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);
+var imageURLPredicate = import_shapeshift.s.string.url({
+ allowedProtocols: ["http:", "https:", "attachment:"]
+}).nullish.setValidationEnabled(isValidationEnabled);
+var urlPredicate = import_shapeshift.s.string.url({
+ allowedProtocols: ["http:", "https:"]
+}).nullish.setValidationEnabled(isValidationEnabled);
+var embedAuthorPredicate = import_shapeshift.s.object({
+ name: authorNamePredicate,
+ iconURL: imageURLPredicate,
+ url: urlPredicate
+}).setValidationEnabled(isValidationEnabled);
+var RGBPredicate = import_shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(255).setValidationEnabled(isValidationEnabled);
+var colorPredicate = import_shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(16777215).or(import_shapeshift.s.tuple([RGBPredicate, RGBPredicate, RGBPredicate])).nullable.setValidationEnabled(isValidationEnabled);
+var descriptionPredicate = import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4096).nullable.setValidationEnabled(isValidationEnabled);
+var footerTextPredicate = import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(2048).nullable.setValidationEnabled(isValidationEnabled);
+var embedFooterPredicate = import_shapeshift.s.object({
+ text: footerTextPredicate,
+ iconURL: imageURLPredicate
+}).setValidationEnabled(isValidationEnabled);
+var timestampPredicate = import_shapeshift.s.union(import_shapeshift.s.number, import_shapeshift.s.date).nullable.setValidationEnabled(isValidationEnabled);
+var titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);
+
+// src/util/normalizeArray.ts
+function normalizeArray(arr) {
+ if (Array.isArray(arr[0]))
+ return arr[0];
+ return arr;
+}
+__name(normalizeArray, "normalizeArray");
+
+// src/messages/embed/Embed.ts
+var EmbedBuilder = class {
+ constructor(data = {}) {
+ __publicField(this, "data");
+ this.data = { ...data };
+ if (data.timestamp)
+ this.data.timestamp = new Date(data.timestamp).toISOString();
+ }
+ addFields(...fields) {
+ fields = normalizeArray(fields);
+ validateFieldLength(fields.length, this.data.fields);
+ embedFieldsArrayPredicate.parse(fields);
+ if (this.data.fields)
+ this.data.fields.push(...fields);
+ else
+ this.data.fields = fields;
+ return this;
+ }
+ spliceFields(index, deleteCount, ...fields) {
+ validateFieldLength(fields.length - deleteCount, this.data.fields);
+ embedFieldsArrayPredicate.parse(fields);
+ if (this.data.fields)
+ this.data.fields.splice(index, deleteCount, ...fields);
+ else
+ this.data.fields = fields;
+ return this;
+ }
+ setFields(...fields) {
+ this.spliceFields(0, this.data.fields?.length ?? 0, ...normalizeArray(fields));
+ return this;
+ }
+ setAuthor(options) {
+ if (options === null) {
+ this.data.author = void 0;
+ return this;
+ }
+ embedAuthorPredicate.parse(options);
+ this.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };
+ return this;
+ }
+ setColor(color) {
+ colorPredicate.parse(color);
+ if (Array.isArray(color)) {
+ const [red, green, blue] = color;
+ this.data.color = (red << 16) + (green << 8) + blue;
+ return this;
+ }
+ this.data.color = color ?? void 0;
+ return this;
+ }
+ setDescription(description) {
+ descriptionPredicate.parse(description);
+ this.data.description = description ?? void 0;
+ return this;
+ }
+ setFooter(options) {
+ if (options === null) {
+ this.data.footer = void 0;
+ return this;
+ }
+ embedFooterPredicate.parse(options);
+ this.data.footer = { text: options.text, icon_url: options.iconURL };
+ return this;
+ }
+ setImage(url) {
+ imageURLPredicate.parse(url);
+ this.data.image = url ? { url } : void 0;
+ return this;
+ }
+ setThumbnail(url) {
+ imageURLPredicate.parse(url);
+ this.data.thumbnail = url ? { url } : void 0;
+ return this;
+ }
+ setTimestamp(timestamp = Date.now()) {
+ timestampPredicate.parse(timestamp);
+ this.data.timestamp = timestamp ? new Date(timestamp).toISOString() : void 0;
+ return this;
+ }
+ setTitle(title) {
+ titlePredicate.parse(title);
+ this.data.title = title ?? void 0;
+ return this;
+ }
+ setURL(url) {
+ urlPredicate.parse(url);
+ this.data.url = url ?? void 0;
+ return this;
+ }
+ toJSON() {
+ return { ...this.data };
+ }
+};
+__name(EmbedBuilder, "EmbedBuilder");
+
+// src/messages/formatters.ts
+function codeBlock(language, content) {
+ return typeof content === "undefined" ? `\`\`\`
+${language}\`\`\`` : `\`\`\`${language}
+${content}\`\`\``;
+}
+__name(codeBlock, "codeBlock");
+function inlineCode(content) {
+ return `\`${content}\``;
+}
+__name(inlineCode, "inlineCode");
+function italic(content) {
+ return `_${content}_`;
+}
+__name(italic, "italic");
+function bold(content) {
+ return `**${content}**`;
+}
+__name(bold, "bold");
+function underscore(content) {
+ return `__${content}__`;
+}
+__name(underscore, "underscore");
+function strikethrough(content) {
+ return `~~${content}~~`;
+}
+__name(strikethrough, "strikethrough");
+function quote(content) {
+ return `> ${content}`;
+}
+__name(quote, "quote");
+function blockQuote(content) {
+ return `>>> ${content}`;
+}
+__name(blockQuote, "blockQuote");
+function hideLinkEmbed(url) {
+ return `<${url}>`;
+}
+__name(hideLinkEmbed, "hideLinkEmbed");
+function hyperlink(content, url, title) {
+ return title ? `[${content}](${url} "${title}")` : `[${content}](${url})`;
+}
+__name(hyperlink, "hyperlink");
+function spoiler(content) {
+ return `||${content}||`;
+}
+__name(spoiler, "spoiler");
+function userMention(userId) {
+ return `<@${userId}>`;
+}
+__name(userMention, "userMention");
+function channelMention(channelId) {
+ return `<#${channelId}>`;
+}
+__name(channelMention, "channelMention");
+function roleMention(roleId) {
+ return `<@&${roleId}>`;
+}
+__name(roleMention, "roleMention");
+function formatEmoji(emojiId, animated = false) {
+ return `<${animated ? "a" : ""}:_:${emojiId}>`;
+}
+__name(formatEmoji, "formatEmoji");
+function time(timeOrSeconds, style) {
+ if (typeof timeOrSeconds !== "number") {
+ timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1e3);
+ }
+ return typeof style === "string" ? `` : ``;
+}
+__name(time, "time");
+var TimestampStyles = {
+ ShortTime: "t",
+ LongTime: "T",
+ ShortDate: "d",
+ LongDate: "D",
+ ShortDateTime: "f",
+ LongDateTime: "F",
+ RelativeTime: "R"
+};
+var Faces = /* @__PURE__ */ ((Faces2) => {
+ Faces2["Shrug"] = "\xAF\\_(\u30C4)\\_/\xAF";
+ Faces2["Tableflip"] = "(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B";
+ Faces2["Unflip"] = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)";
+ return Faces2;
+})(Faces || {});
+
+// src/components/Assertions.ts
+var Assertions_exports2 = {};
+__export(Assertions_exports2, {
+ buttonLabelValidator: () => buttonLabelValidator,
+ buttonStyleValidator: () => buttonStyleValidator,
+ customIdValidator: () => customIdValidator,
+ defaultValidator: () => defaultValidator,
+ disabledValidator: () => disabledValidator,
+ emojiValidator: () => emojiValidator,
+ labelValueDescriptionValidator: () => labelValueDescriptionValidator,
+ minMaxValidator: () => minMaxValidator,
+ optionValidator: () => optionValidator,
+ optionsLengthValidator: () => optionsLengthValidator,
+ optionsValidator: () => optionsValidator,
+ placeholderValidator: () => placeholderValidator,
+ urlValidator: () => urlValidator,
+ validateRequiredButtonParameters: () => validateRequiredButtonParameters,
+ validateRequiredSelectMenuOptionParameters: () => validateRequiredSelectMenuOptionParameters,
+ validateRequiredSelectMenuParameters: () => validateRequiredSelectMenuParameters
+});
+var import_shapeshift2 = require("@sapphire/shapeshift");
+var import_v10 = require("discord-api-types/v10");
+
+// src/components/selectMenu/SelectMenuOption.ts
+var SelectMenuOptionBuilder = class {
+ constructor(data = {}) {
+ this.data = data;
+ }
+ setLabel(label) {
+ this.data.label = labelValueDescriptionValidator.parse(label);
+ return this;
+ }
+ setValue(value) {
+ this.data.value = labelValueDescriptionValidator.parse(value);
+ return this;
+ }
+ setDescription(description) {
+ this.data.description = labelValueDescriptionValidator.parse(description);
+ return this;
+ }
+ setDefault(isDefault = true) {
+ this.data.default = defaultValidator.parse(isDefault);
+ return this;
+ }
+ setEmoji(emoji) {
+ this.data.emoji = emojiValidator.parse(emoji);
+ return this;
+ }
+ toJSON() {
+ validateRequiredSelectMenuOptionParameters(this.data.label, this.data.value);
+ return {
+ ...this.data
+ };
+ }
+};
+__name(SelectMenuOptionBuilder, "SelectMenuOptionBuilder");
+
+// src/components/Assertions.ts
+var customIdValidator = import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
+var emojiValidator = import_shapeshift2.s.object({
+ id: import_shapeshift2.s.string,
+ name: import_shapeshift2.s.string,
+ animated: import_shapeshift2.s.boolean
+}).partial.strict.setValidationEnabled(isValidationEnabled);
+var disabledValidator = import_shapeshift2.s.boolean;
+var buttonLabelValidator = import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(80).setValidationEnabled(isValidationEnabled);
+var buttonStyleValidator = import_shapeshift2.s.nativeEnum(import_v10.ButtonStyle);
+var placeholderValidator = import_shapeshift2.s.string.lengthLessThanOrEqual(150).setValidationEnabled(isValidationEnabled);
+var minMaxValidator = import_shapeshift2.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
+var labelValueDescriptionValidator = import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
+var optionValidator = import_shapeshift2.s.union(import_shapeshift2.s.object({
+ label: labelValueDescriptionValidator,
+ value: labelValueDescriptionValidator,
+ description: labelValueDescriptionValidator.optional,
+ emoji: emojiValidator.optional,
+ default: import_shapeshift2.s.boolean.optional
+}), import_shapeshift2.s.instance(SelectMenuOptionBuilder)).setValidationEnabled(isValidationEnabled);
+var optionsValidator = optionValidator.array.lengthGreaterThanOrEqual(0).setValidationEnabled(isValidationEnabled);
+var optionsLengthValidator = import_shapeshift2.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
+function validateRequiredSelectMenuParameters(options, customId) {
+ customIdValidator.parse(customId);
+ optionsValidator.parse(options);
+}
+__name(validateRequiredSelectMenuParameters, "validateRequiredSelectMenuParameters");
+var defaultValidator = import_shapeshift2.s.boolean;
+function validateRequiredSelectMenuOptionParameters(label, value) {
+ labelValueDescriptionValidator.parse(label);
+ labelValueDescriptionValidator.parse(value);
+}
+__name(validateRequiredSelectMenuOptionParameters, "validateRequiredSelectMenuOptionParameters");
+var urlValidator = import_shapeshift2.s.string.url({
+ allowedProtocols: ["http:", "https:", "discord:"]
+}).setValidationEnabled(isValidationEnabled);
+function validateRequiredButtonParameters(style, label, emoji, customId, url) {
+ if (url && customId) {
+ throw new RangeError("URL and custom id are mutually exclusive");
+ }
+ if (!label && !emoji) {
+ throw new RangeError("Buttons must have a label and/or an emoji");
+ }
+ if (style === import_v10.ButtonStyle.Link) {
+ if (!url) {
+ throw new RangeError("Link buttons must have a url");
+ }
+ } else if (url) {
+ throw new RangeError("Non-link buttons cannot have a url");
+ }
+}
+__name(validateRequiredButtonParameters, "validateRequiredButtonParameters");
+
+// src/components/ActionRow.ts
+var import_v107 = require("discord-api-types/v10");
+
+// src/components/Component.ts
+var ComponentBuilder = class {
+ constructor(data) {
+ __publicField(this, "data");
+ this.data = data;
+ }
+};
+__name(ComponentBuilder, "ComponentBuilder");
+
+// src/components/Components.ts
+var import_v106 = require("discord-api-types/v10");
+
+// src/components/button/Button.ts
+var import_v102 = require("discord-api-types/v10");
+var ButtonBuilder = class extends ComponentBuilder {
+ constructor(data) {
+ super({ type: import_v102.ComponentType.Button, ...data });
+ }
+ setStyle(style) {
+ this.data.style = buttonStyleValidator.parse(style);
+ return this;
+ }
+ setURL(url) {
+ this.data.url = urlValidator.parse(url);
+ return this;
+ }
+ setCustomId(customId) {
+ this.data.custom_id = customIdValidator.parse(customId);
+ return this;
+ }
+ setEmoji(emoji) {
+ this.data.emoji = emojiValidator.parse(emoji);
+ return this;
+ }
+ setDisabled(disabled = true) {
+ this.data.disabled = disabledValidator.parse(disabled);
+ return this;
+ }
+ setLabel(label) {
+ this.data.label = buttonLabelValidator.parse(label);
+ return this;
+ }
+ toJSON() {
+ validateRequiredButtonParameters(this.data.style, this.data.label, this.data.emoji, this.data.custom_id, this.data.url);
+ return {
+ ...this.data
+ };
+ }
+};
+__name(ButtonBuilder, "ButtonBuilder");
+
+// src/components/selectMenu/SelectMenu.ts
+var import_v103 = require("discord-api-types/v10");
+var SelectMenuBuilder = class extends ComponentBuilder {
+ constructor(data) {
+ const { options, ...initData } = data ?? {};
+ super({ type: import_v103.ComponentType.SelectMenu, ...initData });
+ __publicField(this, "options");
+ this.options = options?.map((o) => new SelectMenuOptionBuilder(o)) ?? [];
+ }
+ setPlaceholder(placeholder) {
+ this.data.placeholder = placeholderValidator.parse(placeholder);
+ return this;
+ }
+ setMinValues(minValues) {
+ this.data.min_values = minMaxValidator.parse(minValues);
+ return this;
+ }
+ setMaxValues(maxValues) {
+ this.data.max_values = minMaxValidator.parse(maxValues);
+ return this;
+ }
+ setCustomId(customId) {
+ this.data.custom_id = customIdValidator.parse(customId);
+ return this;
+ }
+ setDisabled(disabled = true) {
+ this.data.disabled = disabledValidator.parse(disabled);
+ return this;
+ }
+ addOptions(...options) {
+ options = normalizeArray(options);
+ optionsLengthValidator.parse(this.options.length + options.length);
+ this.options.push(...options.map((option) => option instanceof SelectMenuOptionBuilder ? option : new SelectMenuOptionBuilder(optionValidator.parse(option))));
+ return this;
+ }
+ setOptions(...options) {
+ options = normalizeArray(options);
+ optionsLengthValidator.parse(options.length);
+ this.options.splice(0, this.options.length, ...options.map((option) => option instanceof SelectMenuOptionBuilder ? option : new SelectMenuOptionBuilder(optionValidator.parse(option))));
+ return this;
+ }
+ toJSON() {
+ validateRequiredSelectMenuParameters(this.options, this.data.custom_id);
+ return {
+ ...this.data,
+ options: this.options.map((o) => o.toJSON())
+ };
+ }
+};
+__name(SelectMenuBuilder, "SelectMenuBuilder");
+
+// src/components/textInput/TextInput.ts
+var import_v105 = require("discord-api-types/v10");
+var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
+
+// src/components/textInput/Assertions.ts
+var Assertions_exports3 = {};
+__export(Assertions_exports3, {
+ labelValidator: () => labelValidator,
+ maxLengthValidator: () => maxLengthValidator,
+ minLengthValidator: () => minLengthValidator,
+ placeholderValidator: () => placeholderValidator2,
+ requiredValidator: () => requiredValidator,
+ textInputStyleValidator: () => textInputStyleValidator,
+ validateRequiredParameters: () => validateRequiredParameters,
+ valueValidator: () => valueValidator
+});
+var import_shapeshift3 = require("@sapphire/shapeshift");
+var import_v104 = require("discord-api-types/v10");
+var textInputStyleValidator = import_shapeshift3.s.nativeEnum(import_v104.TextInputStyle);
+var minLengthValidator = import_shapeshift3.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
+var maxLengthValidator = import_shapeshift3.s.number.int.greaterThanOrEqual(1).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
+var requiredValidator = import_shapeshift3.s.boolean;
+var valueValidator = import_shapeshift3.s.string.lengthLessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled);
+var placeholderValidator2 = import_shapeshift3.s.string.lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
+var labelValidator = import_shapeshift3.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
+function validateRequiredParameters(customId, style, label) {
+ customIdValidator.parse(customId);
+ textInputStyleValidator.parse(style);
+ labelValidator.parse(label);
+}
+__name(validateRequiredParameters, "validateRequiredParameters");
+
+// src/util/jsonEncodable.ts
+function isJSONEncodable(maybeEncodable) {
+ return maybeEncodable !== null && typeof maybeEncodable === "object" && "toJSON" in maybeEncodable;
+}
+__name(isJSONEncodable, "isJSONEncodable");
+
+// src/components/textInput/TextInput.ts
+var TextInputBuilder = class extends ComponentBuilder {
+ constructor(data) {
+ super({ type: import_v105.ComponentType.TextInput, ...data });
+ }
+ setCustomId(customId) {
+ this.data.custom_id = customIdValidator.parse(customId);
+ return this;
+ }
+ setLabel(label) {
+ this.data.label = labelValidator.parse(label);
+ return this;
+ }
+ setStyle(style) {
+ this.data.style = textInputStyleValidator.parse(style);
+ return this;
+ }
+ setMinLength(minLength) {
+ this.data.min_length = minLengthValidator.parse(minLength);
+ return this;
+ }
+ setMaxLength(maxLength) {
+ this.data.max_length = maxLengthValidator.parse(maxLength);
+ return this;
+ }
+ setPlaceholder(placeholder) {
+ this.data.placeholder = placeholderValidator2.parse(placeholder);
+ return this;
+ }
+ setValue(value) {
+ this.data.value = valueValidator.parse(value);
+ return this;
+ }
+ setRequired(required = true) {
+ this.data.required = requiredValidator.parse(required);
+ return this;
+ }
+ toJSON() {
+ validateRequiredParameters(this.data.custom_id, this.data.style, this.data.label);
+ return {
+ ...this.data
+ };
+ }
+ equals(other) {
+ if (isJSONEncodable(other)) {
+ return (0, import_fast_deep_equal.default)(other.toJSON(), this.data);
+ }
+ return (0, import_fast_deep_equal.default)(other, this.data);
+ }
+};
+__name(TextInputBuilder, "TextInputBuilder");
+
+// src/components/Components.ts
+function createComponentBuilder(data) {
+ if (data instanceof ComponentBuilder) {
+ return data;
+ }
+ switch (data.type) {
+ case import_v106.ComponentType.ActionRow:
+ return new ActionRowBuilder(data);
+ case import_v106.ComponentType.Button:
+ return new ButtonBuilder(data);
+ case import_v106.ComponentType.SelectMenu:
+ return new SelectMenuBuilder(data);
+ case import_v106.ComponentType.TextInput:
+ return new TextInputBuilder(data);
+ default:
+ throw new Error(`Cannot properly serialize component type: ${data.type}`);
+ }
+}
+__name(createComponentBuilder, "createComponentBuilder");
+
+// src/components/ActionRow.ts
+var ActionRowBuilder = class extends ComponentBuilder {
+ constructor({ components, ...data } = {}) {
+ super({ type: import_v107.ComponentType.ActionRow, ...data });
+ __publicField(this, "components");
+ this.components = components?.map((c) => createComponentBuilder(c)) ?? [];
+ }
+ addComponents(...components) {
+ this.components.push(...normalizeArray(components));
+ return this;
+ }
+ setComponents(...components) {
+ this.components.splice(0, this.components.length, ...normalizeArray(components));
+ return this;
+ }
+ toJSON() {
+ return {
+ ...this.data,
+ components: this.components.map((component) => component.toJSON())
+ };
+ }
+};
+__name(ActionRowBuilder, "ActionRowBuilder");
+
+// src/interactions/modals/Assertions.ts
+var Assertions_exports4 = {};
+__export(Assertions_exports4, {
+ componentsValidator: () => componentsValidator,
+ titleValidator: () => titleValidator,
+ validateRequiredParameters: () => validateRequiredParameters2
+});
+var import_shapeshift4 = require("@sapphire/shapeshift");
+var titleValidator = import_shapeshift4.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
+var componentsValidator = import_shapeshift4.s.instance(ActionRowBuilder).array.lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);
+function validateRequiredParameters2(customId, title, components) {
+ customIdValidator.parse(customId);
+ titleValidator.parse(title);
+ componentsValidator.parse(components);
+}
+__name(validateRequiredParameters2, "validateRequiredParameters");
+
+// src/interactions/modals/Modal.ts
+var ModalBuilder = class {
+ constructor({ components, ...data } = {}) {
+ __publicField(this, "data");
+ __publicField(this, "components", []);
+ this.data = { ...data };
+ this.components = components?.map((c) => createComponentBuilder(c)) ?? [];
+ }
+ setTitle(title) {
+ this.data.title = titleValidator.parse(title);
+ return this;
+ }
+ setCustomId(customId) {
+ this.data.custom_id = customIdValidator.parse(customId);
+ return this;
+ }
+ addComponents(...components) {
+ this.components.push(...normalizeArray(components).map((component) => component instanceof ActionRowBuilder ? component : new ActionRowBuilder(component)));
+ return this;
+ }
+ setComponents(...components) {
+ this.components.splice(0, this.components.length, ...normalizeArray(components));
+ return this;
+ }
+ toJSON() {
+ validateRequiredParameters2(this.data.custom_id, this.data.title, this.components);
+ return {
+ ...this.data,
+ components: this.components.map((component) => component.toJSON())
+ };
+ }
+};
+__name(ModalBuilder, "ModalBuilder");
+
+// src/interactions/slashCommands/Assertions.ts
+var Assertions_exports5 = {};
+__export(Assertions_exports5, {
+ assertReturnOfBuilder: () => assertReturnOfBuilder,
+ localizationMapPredicate: () => localizationMapPredicate,
+ validateChoicesLength: () => validateChoicesLength,
+ validateDMPermission: () => validateDMPermission,
+ validateDefaultMemberPermissions: () => validateDefaultMemberPermissions,
+ validateDefaultPermission: () => validateDefaultPermission,
+ validateDescription: () => validateDescription,
+ validateLocale: () => validateLocale,
+ validateLocalizationMap: () => validateLocalizationMap,
+ validateMaxOptionsLength: () => validateMaxOptionsLength,
+ validateName: () => validateName,
+ validateRequired: () => validateRequired,
+ validateRequiredParameters: () => validateRequiredParameters3
+});
+var import_shapeshift5 = require("@sapphire/shapeshift");
+var import_v108 = require("discord-api-types/v10");
+var namePredicate = import_shapeshift5.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u).setValidationEnabled(isValidationEnabled);
+function validateName(name) {
+ namePredicate.parse(name);
+}
+__name(validateName, "validateName");
+var descriptionPredicate2 = import_shapeshift5.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
+var localePredicate = import_shapeshift5.s.nativeEnum(import_v108.Locale);
+function validateDescription(description) {
+ descriptionPredicate2.parse(description);
+}
+__name(validateDescription, "validateDescription");
+var maxArrayLengthPredicate = import_shapeshift5.s.unknown.array.lengthLessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
+function validateLocale(locale) {
+ return localePredicate.parse(locale);
+}
+__name(validateLocale, "validateLocale");
+function validateMaxOptionsLength(options) {
+ maxArrayLengthPredicate.parse(options);
+}
+__name(validateMaxOptionsLength, "validateMaxOptionsLength");
+function validateRequiredParameters3(name, description, options) {
+ validateName(name);
+ validateDescription(description);
+ validateMaxOptionsLength(options);
+}
+__name(validateRequiredParameters3, "validateRequiredParameters");
+var booleanPredicate = import_shapeshift5.s.boolean;
+function validateDefaultPermission(value) {
+ booleanPredicate.parse(value);
+}
+__name(validateDefaultPermission, "validateDefaultPermission");
+function validateRequired(required) {
+ booleanPredicate.parse(required);
+}
+__name(validateRequired, "validateRequired");
+var choicesLengthPredicate = import_shapeshift5.s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);
+function validateChoicesLength(amountAdding, choices) {
+ choicesLengthPredicate.parse((choices?.length ?? 0) + amountAdding);
+}
+__name(validateChoicesLength, "validateChoicesLength");
+function assertReturnOfBuilder(input, ExpectedInstanceOf) {
+ import_shapeshift5.s.instance(ExpectedInstanceOf).parse(input);
+}
+__name(assertReturnOfBuilder, "assertReturnOfBuilder");
+var localizationMapPredicate = import_shapeshift5.s.object(Object.fromEntries(Object.values(import_v108.Locale).map((locale) => [locale, import_shapeshift5.s.string.nullish]))).strict.nullish.setValidationEnabled(isValidationEnabled);
+function validateLocalizationMap(value) {
+ localizationMapPredicate.parse(value);
+}
+__name(validateLocalizationMap, "validateLocalizationMap");
+var dmPermissionPredicate = import_shapeshift5.s.boolean.nullish;
+function validateDMPermission(value) {
+ dmPermissionPredicate.parse(value);
+}
+__name(validateDMPermission, "validateDMPermission");
+var memberPermissionPredicate = import_shapeshift5.s.union(import_shapeshift5.s.bigint.transform((value) => value.toString()), import_shapeshift5.s.number.safeInt.transform((value) => value.toString()), import_shapeshift5.s.string.regex(/^\d+$/)).nullish;
+function validateDefaultMemberPermissions(permissions) {
+ return memberPermissionPredicate.parse(permissions);
+}
+__name(validateDefaultMemberPermissions, "validateDefaultMemberPermissions");
+
+// src/interactions/slashCommands/SlashCommandBuilder.ts
+var import_ts_mixer6 = require("ts-mixer");
+
+// src/interactions/slashCommands/SlashCommandSubcommands.ts
+var import_v1020 = require("discord-api-types/v10");
+var import_ts_mixer5 = require("ts-mixer");
+
+// src/interactions/slashCommands/mixins/NameAndDescription.ts
+var SharedNameAndDescription = class {
+ constructor() {
+ __publicField(this, "name");
+ __publicField(this, "name_localizations");
+ __publicField(this, "description");
+ __publicField(this, "description_localizations");
+ }
+ setName(name) {
+ validateName(name);
+ Reflect.set(this, "name", name);
+ return this;
+ }
+ setDescription(description) {
+ validateDescription(description);
+ Reflect.set(this, "description", description);
+ return this;
+ }
+ setNameLocalization(locale, localizedName) {
+ if (!this.name_localizations) {
+ Reflect.set(this, "name_localizations", {});
+ }
+ const parsedLocale = validateLocale(locale);
+ if (localizedName === null) {
+ this.name_localizations[parsedLocale] = null;
+ return this;
+ }
+ validateName(localizedName);
+ this.name_localizations[parsedLocale] = localizedName;
+ return this;
+ }
+ setNameLocalizations(localizedNames) {
+ if (localizedNames === null) {
+ Reflect.set(this, "name_localizations", null);
+ return this;
+ }
+ Reflect.set(this, "name_localizations", {});
+ Object.entries(localizedNames).forEach((args) => this.setNameLocalization(...args));
+ return this;
+ }
+ setDescriptionLocalization(locale, localizedDescription) {
+ if (!this.description_localizations) {
+ Reflect.set(this, "description_localizations", {});
+ }
+ const parsedLocale = validateLocale(locale);
+ if (localizedDescription === null) {
+ this.description_localizations[parsedLocale] = null;
+ return this;
+ }
+ validateDescription(localizedDescription);
+ this.description_localizations[parsedLocale] = localizedDescription;
+ return this;
+ }
+ setDescriptionLocalizations(localizedDescriptions) {
+ if (localizedDescriptions === null) {
+ Reflect.set(this, "description_localizations", null);
+ return this;
+ }
+ Reflect.set(this, "description_localizations", {});
+ Object.entries(localizedDescriptions).forEach((args) => this.setDescriptionLocalization(...args));
+ return this;
+ }
+};
+__name(SharedNameAndDescription, "SharedNameAndDescription");
+
+// src/interactions/slashCommands/options/attachment.ts
+var import_v109 = require("discord-api-types/v10");
+
+// src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts
+var ApplicationCommandOptionBase = class extends SharedNameAndDescription {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "required", false);
+ }
+ setRequired(required) {
+ validateRequired(required);
+ Reflect.set(this, "required", required);
+ return this;
+ }
+ runRequiredValidations() {
+ validateRequiredParameters3(this.name, this.description, []);
+ validateLocalizationMap(this.name_localizations);
+ validateLocalizationMap(this.description_localizations);
+ validateRequired(this.required);
+ }
+};
+__name(ApplicationCommandOptionBase, "ApplicationCommandOptionBase");
+
+// src/interactions/slashCommands/options/attachment.ts
+var SlashCommandAttachmentOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v109.ApplicationCommandOptionType.Attachment);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandAttachmentOption, "SlashCommandAttachmentOption");
+
+// src/interactions/slashCommands/options/boolean.ts
+var import_v1010 = require("discord-api-types/v10");
+var SlashCommandBooleanOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1010.ApplicationCommandOptionType.Boolean);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandBooleanOption, "SlashCommandBooleanOption");
+
+// src/interactions/slashCommands/options/channel.ts
+var import_v1012 = require("discord-api-types/v10");
+var import_ts_mixer = require("ts-mixer");
+
+// src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts
+var import_shapeshift6 = require("@sapphire/shapeshift");
+var import_v1011 = require("discord-api-types/v10");
+var allowedChannelTypes = [
+ import_v1011.ChannelType.GuildText,
+ import_v1011.ChannelType.GuildVoice,
+ import_v1011.ChannelType.GuildCategory,
+ import_v1011.ChannelType.GuildNews,
+ import_v1011.ChannelType.GuildNewsThread,
+ import_v1011.ChannelType.GuildPublicThread,
+ import_v1011.ChannelType.GuildPrivateThread,
+ import_v1011.ChannelType.GuildStageVoice
+];
+var channelTypesPredicate = import_shapeshift6.s.array(import_shapeshift6.s.union(...allowedChannelTypes.map((type) => import_shapeshift6.s.literal(type))));
+var ApplicationCommandOptionChannelTypesMixin = class {
+ constructor() {
+ __publicField(this, "channel_types");
+ }
+ addChannelTypes(...channelTypes) {
+ if (this.channel_types === void 0) {
+ Reflect.set(this, "channel_types", []);
+ }
+ this.channel_types.push(...channelTypesPredicate.parse(channelTypes));
+ return this;
+ }
+};
+__name(ApplicationCommandOptionChannelTypesMixin, "ApplicationCommandOptionChannelTypesMixin");
+
+// src/interactions/slashCommands/options/channel.ts
+var SlashCommandChannelOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1012.ApplicationCommandOptionType.Channel);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandChannelOption, "SlashCommandChannelOption");
+SlashCommandChannelOption = __decorateClass([
+ (0, import_ts_mixer.mix)(ApplicationCommandOptionChannelTypesMixin)
+], SlashCommandChannelOption);
+
+// src/interactions/slashCommands/options/integer.ts
+var import_shapeshift8 = require("@sapphire/shapeshift");
+var import_v1014 = require("discord-api-types/v10");
+var import_ts_mixer2 = require("ts-mixer");
+
+// src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts
+var ApplicationCommandNumericOptionMinMaxValueMixin = class {
+ constructor() {
+ __publicField(this, "max_value");
+ __publicField(this, "min_value");
+ }
+};
+__name(ApplicationCommandNumericOptionMinMaxValueMixin, "ApplicationCommandNumericOptionMinMaxValueMixin");
+
+// src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts
+var import_shapeshift7 = require("@sapphire/shapeshift");
+var import_v1013 = require("discord-api-types/v10");
+var stringPredicate = import_shapeshift7.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100);
+var numberPredicate = import_shapeshift7.s.number.greaterThan(-Infinity).lessThan(Infinity);
+var choicesPredicate = import_shapeshift7.s.object({
+ name: stringPredicate,
+ name_localizations: localizationMapPredicate,
+ value: import_shapeshift7.s.union(stringPredicate, numberPredicate)
+}).array;
+var booleanPredicate2 = import_shapeshift7.s.boolean;
+var ApplicationCommandOptionWithChoicesAndAutocompleteMixin = class {
+ constructor() {
+ __publicField(this, "choices");
+ __publicField(this, "autocomplete");
+ __publicField(this, "type");
+ }
+ addChoices(...choices) {
+ if (choices.length > 0 && this.autocomplete) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ choicesPredicate.parse(choices);
+ if (this.choices === void 0) {
+ Reflect.set(this, "choices", []);
+ }
+ validateChoicesLength(choices.length, this.choices);
+ for (const { name, name_localizations, value } of choices) {
+ if (this.type === import_v1013.ApplicationCommandOptionType.String) {
+ stringPredicate.parse(value);
+ } else {
+ numberPredicate.parse(value);
+ }
+ this.choices.push({ name, name_localizations, value });
+ }
+ return this;
+ }
+ setChoices(...choices) {
+ if (choices.length > 0 && this.autocomplete) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ choicesPredicate.parse(choices);
+ Reflect.set(this, "choices", []);
+ this.addChoices(...choices);
+ return this;
+ }
+ setAutocomplete(autocomplete) {
+ booleanPredicate2.parse(autocomplete);
+ if (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ Reflect.set(this, "autocomplete", autocomplete);
+ return this;
+ }
+};
+__name(ApplicationCommandOptionWithChoicesAndAutocompleteMixin, "ApplicationCommandOptionWithChoicesAndAutocompleteMixin");
+
+// src/interactions/slashCommands/options/integer.ts
+var numberValidator = import_shapeshift8.s.number.int;
+var SlashCommandIntegerOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1014.ApplicationCommandOptionType.Integer);
+ }
+ setMaxValue(max) {
+ numberValidator.parse(max);
+ Reflect.set(this, "max_value", max);
+ return this;
+ }
+ setMinValue(min) {
+ numberValidator.parse(min);
+ Reflect.set(this, "min_value", min);
+ return this;
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ return { ...this };
+ }
+};
+__name(SlashCommandIntegerOption, "SlashCommandIntegerOption");
+SlashCommandIntegerOption = __decorateClass([
+ (0, import_ts_mixer2.mix)(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
+], SlashCommandIntegerOption);
+
+// src/interactions/slashCommands/options/mentionable.ts
+var import_v1015 = require("discord-api-types/v10");
+var SlashCommandMentionableOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1015.ApplicationCommandOptionType.Mentionable);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandMentionableOption, "SlashCommandMentionableOption");
+
+// src/interactions/slashCommands/options/number.ts
+var import_shapeshift9 = require("@sapphire/shapeshift");
+var import_v1016 = require("discord-api-types/v10");
+var import_ts_mixer3 = require("ts-mixer");
+var numberValidator2 = import_shapeshift9.s.number;
+var SlashCommandNumberOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1016.ApplicationCommandOptionType.Number);
+ }
+ setMaxValue(max) {
+ numberValidator2.parse(max);
+ Reflect.set(this, "max_value", max);
+ return this;
+ }
+ setMinValue(min) {
+ numberValidator2.parse(min);
+ Reflect.set(this, "min_value", min);
+ return this;
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ return { ...this };
+ }
+};
+__name(SlashCommandNumberOption, "SlashCommandNumberOption");
+SlashCommandNumberOption = __decorateClass([
+ (0, import_ts_mixer3.mix)(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
+], SlashCommandNumberOption);
+
+// src/interactions/slashCommands/options/role.ts
+var import_v1017 = require("discord-api-types/v10");
+var SlashCommandRoleOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1017.ApplicationCommandOptionType.Role);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandRoleOption, "SlashCommandRoleOption");
+
+// src/interactions/slashCommands/options/string.ts
+var import_shapeshift10 = require("@sapphire/shapeshift");
+var import_v1018 = require("discord-api-types/v10");
+var import_ts_mixer4 = require("ts-mixer");
+var minLengthValidator2 = import_shapeshift10.s.number.greaterThanOrEqual(0).lessThanOrEqual(6e3);
+var maxLengthValidator2 = import_shapeshift10.s.number.greaterThanOrEqual(1).lessThanOrEqual(6e3);
+var SlashCommandStringOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1018.ApplicationCommandOptionType.String);
+ __publicField(this, "max_length");
+ __publicField(this, "min_length");
+ }
+ setMaxLength(max) {
+ maxLengthValidator2.parse(max);
+ Reflect.set(this, "max_length", max);
+ return this;
+ }
+ setMinLength(min) {
+ minLengthValidator2.parse(min);
+ Reflect.set(this, "min_length", min);
+ return this;
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
+ }
+ return { ...this };
+ }
+};
+__name(SlashCommandStringOption, "SlashCommandStringOption");
+SlashCommandStringOption = __decorateClass([
+ (0, import_ts_mixer4.mix)(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
+], SlashCommandStringOption);
+
+// src/interactions/slashCommands/options/user.ts
+var import_v1019 = require("discord-api-types/v10");
+var SlashCommandUserOption = class extends ApplicationCommandOptionBase {
+ constructor() {
+ super(...arguments);
+ __publicField(this, "type", import_v1019.ApplicationCommandOptionType.User);
+ }
+ toJSON() {
+ this.runRequiredValidations();
+ return { ...this };
+ }
+};
+__name(SlashCommandUserOption, "SlashCommandUserOption");
+
+// src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts
+var SharedSlashCommandOptions = class {
+ constructor() {
+ __publicField(this, "options");
+ }
+ addBooleanOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandBooleanOption);
+ }
+ addUserOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandUserOption);
+ }
+ addChannelOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandChannelOption);
+ }
+ addRoleOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandRoleOption);
+ }
+ addAttachmentOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);
+ }
+ addMentionableOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandMentionableOption);
+ }
+ addStringOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandStringOption);
+ }
+ addIntegerOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandIntegerOption);
+ }
+ addNumberOption(input) {
+ return this._sharedAddOptionMethod(input, SlashCommandNumberOption);
+ }
+ _sharedAddOptionMethod(input, Instance) {
+ const { options } = this;
+ validateMaxOptionsLength(options);
+ const result = typeof input === "function" ? input(new Instance()) : input;
+ assertReturnOfBuilder(result, Instance);
+ options.push(result);
+ return this;
+ }
+};
+__name(SharedSlashCommandOptions, "SharedSlashCommandOptions");
+
+// src/interactions/slashCommands/SlashCommandSubcommands.ts
+var SlashCommandSubcommandGroupBuilder = class {
+ constructor() {
+ __publicField(this, "name");
+ __publicField(this, "description");
+ __publicField(this, "options", []);
+ }
+ addSubcommand(input) {
+ const { options } = this;
+ validateMaxOptionsLength(options);
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
+ assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
+ options.push(result);
+ return this;
+ }
+ toJSON() {
+ validateRequiredParameters3(this.name, this.description, this.options);
+ return {
+ type: import_v1020.ApplicationCommandOptionType.SubcommandGroup,
+ name: this.name,
+ name_localizations: this.name_localizations,
+ description: this.description,
+ description_localizations: this.description_localizations,
+ options: this.options.map((option) => option.toJSON())
+ };
+ }
+};
+__name(SlashCommandSubcommandGroupBuilder, "SlashCommandSubcommandGroupBuilder");
+SlashCommandSubcommandGroupBuilder = __decorateClass([
+ (0, import_ts_mixer5.mix)(SharedNameAndDescription)
+], SlashCommandSubcommandGroupBuilder);
+var SlashCommandSubcommandBuilder = class {
+ constructor() {
+ __publicField(this, "name");
+ __publicField(this, "description");
+ __publicField(this, "options", []);
+ }
+ toJSON() {
+ validateRequiredParameters3(this.name, this.description, this.options);
+ return {
+ type: import_v1020.ApplicationCommandOptionType.Subcommand,
+ name: this.name,
+ name_localizations: this.name_localizations,
+ description: this.description,
+ description_localizations: this.description_localizations,
+ options: this.options.map((option) => option.toJSON())
+ };
+ }
+};
+__name(SlashCommandSubcommandBuilder, "SlashCommandSubcommandBuilder");
+SlashCommandSubcommandBuilder = __decorateClass([
+ (0, import_ts_mixer5.mix)(SharedNameAndDescription, SharedSlashCommandOptions)
+], SlashCommandSubcommandBuilder);
+
+// src/interactions/slashCommands/SlashCommandBuilder.ts
+var SlashCommandBuilder = class {
+ constructor() {
+ __publicField(this, "name");
+ __publicField(this, "name_localizations");
+ __publicField(this, "description");
+ __publicField(this, "description_localizations");
+ __publicField(this, "options", []);
+ __publicField(this, "default_permission");
+ __publicField(this, "default_member_permissions");
+ __publicField(this, "dm_permission");
+ }
+ toJSON() {
+ validateRequiredParameters3(this.name, this.description, this.options);
+ validateLocalizationMap(this.name_localizations);
+ validateLocalizationMap(this.description_localizations);
+ return {
+ ...this,
+ options: this.options.map((option) => option.toJSON())
+ };
+ }
+ setDefaultPermission(value) {
+ validateDefaultPermission(value);
+ Reflect.set(this, "default_permission", value);
+ return this;
+ }
+ setDefaultMemberPermissions(permissions) {
+ const permissionValue = validateDefaultMemberPermissions(permissions);
+ Reflect.set(this, "default_member_permissions", permissionValue);
+ return this;
+ }
+ setDMPermission(enabled) {
+ validateDMPermission(enabled);
+ Reflect.set(this, "dm_permission", enabled);
+ return this;
+ }
+ addSubcommandGroup(input) {
+ const { options } = this;
+ validateMaxOptionsLength(options);
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandGroupBuilder()) : input;
+ assertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);
+ options.push(result);
+ return this;
+ }
+ addSubcommand(input) {
+ const { options } = this;
+ validateMaxOptionsLength(options);
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
+ assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
+ options.push(result);
+ return this;
+ }
+};
+__name(SlashCommandBuilder, "SlashCommandBuilder");
+SlashCommandBuilder = __decorateClass([
+ (0, import_ts_mixer6.mix)(SharedSlashCommandOptions, SharedNameAndDescription)
+], SlashCommandBuilder);
+
+// src/interactions/contextMenuCommands/Assertions.ts
+var Assertions_exports6 = {};
+__export(Assertions_exports6, {
+ validateDMPermission: () => validateDMPermission2,
+ validateDefaultMemberPermissions: () => validateDefaultMemberPermissions2,
+ validateDefaultPermission: () => validateDefaultPermission2,
+ validateName: () => validateName2,
+ validateRequiredParameters: () => validateRequiredParameters4,
+ validateType: () => validateType
+});
+var import_shapeshift11 = require("@sapphire/shapeshift");
+var import_v1021 = require("discord-api-types/v10");
+var namePredicate2 = import_shapeshift11.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^( *[\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+ *)+$/u).setValidationEnabled(isValidationEnabled);
+var typePredicate = import_shapeshift11.s.union(import_shapeshift11.s.literal(import_v1021.ApplicationCommandType.User), import_shapeshift11.s.literal(import_v1021.ApplicationCommandType.Message)).setValidationEnabled(isValidationEnabled);
+var booleanPredicate3 = import_shapeshift11.s.boolean;
+function validateDefaultPermission2(value) {
+ booleanPredicate3.parse(value);
+}
+__name(validateDefaultPermission2, "validateDefaultPermission");
+function validateName2(name) {
+ namePredicate2.parse(name);
+}
+__name(validateName2, "validateName");
+function validateType(type) {
+ typePredicate.parse(type);
+}
+__name(validateType, "validateType");
+function validateRequiredParameters4(name, type) {
+ validateName2(name);
+ validateType(type);
+}
+__name(validateRequiredParameters4, "validateRequiredParameters");
+var dmPermissionPredicate2 = import_shapeshift11.s.boolean.nullish;
+function validateDMPermission2(value) {
+ dmPermissionPredicate2.parse(value);
+}
+__name(validateDMPermission2, "validateDMPermission");
+var memberPermissionPredicate2 = import_shapeshift11.s.union(import_shapeshift11.s.bigint.transform((value) => value.toString()), import_shapeshift11.s.number.safeInt.transform((value) => value.toString()), import_shapeshift11.s.string.regex(/^\d+$/)).nullish;
+function validateDefaultMemberPermissions2(permissions) {
+ return memberPermissionPredicate2.parse(permissions);
+}
+__name(validateDefaultMemberPermissions2, "validateDefaultMemberPermissions");
+
+// src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts
+var ContextMenuCommandBuilder = class {
+ constructor() {
+ __publicField(this, "name");
+ __publicField(this, "name_localizations");
+ __publicField(this, "type");
+ __publicField(this, "default_permission");
+ __publicField(this, "default_member_permissions");
+ __publicField(this, "dm_permission");
+ }
+ setName(name) {
+ validateName2(name);
+ Reflect.set(this, "name", name);
+ return this;
+ }
+ setType(type) {
+ validateType(type);
+ Reflect.set(this, "type", type);
+ return this;
+ }
+ setDefaultPermission(value) {
+ validateDefaultPermission2(value);
+ Reflect.set(this, "default_permission", value);
+ return this;
+ }
+ setDefaultMemberPermissions(permissions) {
+ const permissionValue = validateDefaultMemberPermissions2(permissions);
+ Reflect.set(this, "default_member_permissions", permissionValue);
+ return this;
+ }
+ setDMPermission(enabled) {
+ validateDMPermission2(enabled);
+ Reflect.set(this, "dm_permission", enabled);
+ return this;
+ }
+ setNameLocalization(locale, localizedName) {
+ if (!this.name_localizations) {
+ Reflect.set(this, "name_localizations", {});
+ }
+ const parsedLocale = validateLocale(locale);
+ if (localizedName === null) {
+ this.name_localizations[parsedLocale] = null;
+ return this;
+ }
+ validateName2(localizedName);
+ this.name_localizations[parsedLocale] = localizedName;
+ return this;
+ }
+ setNameLocalizations(localizedNames) {
+ if (localizedNames === null) {
+ Reflect.set(this, "name_localizations", null);
+ return this;
+ }
+ Reflect.set(this, "name_localizations", {});
+ Object.entries(localizedNames).forEach((args) => this.setNameLocalization(...args));
+ return this;
+ }
+ toJSON() {
+ validateRequiredParameters4(this.name, this.type);
+ validateLocalizationMap(this.name_localizations);
+ return { ...this };
+ }
+};
+__name(ContextMenuCommandBuilder, "ContextMenuCommandBuilder");
+
+// src/util/equatable.ts
+function isEquatable(maybeEquatable) {
+ return maybeEquatable !== null && typeof maybeEquatable === "object" && "equals" in maybeEquatable;
+}
+__name(isEquatable, "isEquatable");
+
+// src/util/componentUtil.ts
+function embedLength(data) {
+ return (data.title?.length ?? 0) + (data.description?.length ?? 0) + (data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) + (data.footer?.text.length ?? 0) + (data.author?.name.length ?? 0);
+}
+__name(embedLength, "embedLength");
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+ ActionRowBuilder,
+ ApplicationCommandNumericOptionMinMaxValueMixin,
+ ApplicationCommandOptionBase,
+ ApplicationCommandOptionChannelTypesMixin,
+ ApplicationCommandOptionWithChoicesAndAutocompleteMixin,
+ ButtonBuilder,
+ ComponentAssertions,
+ ComponentBuilder,
+ ContextMenuCommandAssertions,
+ ContextMenuCommandBuilder,
+ EmbedAssertions,
+ EmbedBuilder,
+ Faces,
+ ModalAssertions,
+ ModalBuilder,
+ SelectMenuBuilder,
+ SelectMenuOptionBuilder,
+ SharedNameAndDescription,
+ SharedSlashCommandOptions,
+ SlashCommandAssertions,
+ SlashCommandAttachmentOption,
+ SlashCommandBooleanOption,
+ SlashCommandBuilder,
+ SlashCommandChannelOption,
+ SlashCommandIntegerOption,
+ SlashCommandMentionableOption,
+ SlashCommandNumberOption,
+ SlashCommandRoleOption,
+ SlashCommandStringOption,
+ SlashCommandSubcommandBuilder,
+ SlashCommandSubcommandGroupBuilder,
+ SlashCommandUserOption,
+ TextInputAssertions,
+ TextInputBuilder,
+ TimestampStyles,
+ blockQuote,
+ bold,
+ channelMention,
+ codeBlock,
+ createComponentBuilder,
+ disableValidators,
+ embedLength,
+ enableValidators,
+ formatEmoji,
+ hideLinkEmbed,
+ hyperlink,
+ inlineCode,
+ isEquatable,
+ isJSONEncodable,
+ isValidationEnabled,
+ italic,
+ normalizeArray,
+ quote,
+ roleMention,
+ spoiler,
+ strikethrough,
+ time,
+ underscore,
+ userMention
+});
//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@discordjs/builders/dist/index.js.map b/node_modules/@discordjs/builders/dist/index.js.map
index 72c1248..e55c55b 100644
--- a/node_modules/@discordjs/builders/dist/index.js.map
+++ b/node_modules/@discordjs/builders/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/index.ts","../src/messages/embed/Assertions.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts"],"sourcesContent":["export * as EmbedAssertions from './messages/embed/Assertions';\nexport * from './messages/embed/Embed';\nexport * from './messages/formatters';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/number';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\n\nexport * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';\nexport * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void {\n\tfieldLengthPredicate.parse(fields.length + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const colorPredicate = z.number().gte(0).lte(0xffffff).nullable();\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedProvider,\n\tAPIEmbedThumbnail,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfieldInlinePredicate,\n\tfieldNamePredicate,\n\tfieldValuePredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\n\nexport interface AuthorOptions {\n\tname: string;\n\turl?: string;\n\ticonURL?: string;\n}\n\nexport interface FooterOptions {\n\ttext: string;\n\ticonURL?: string;\n}\n\n/**\n * Represents an embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed implements APIEmbed {\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic fields: APIEmbedField[];\n\n\t/**\n\t * The embed title\n\t */\n\tpublic title?: string;\n\n\t/**\n\t * The embed description\n\t */\n\tpublic description?: string;\n\n\t/**\n\t * The embed url\n\t */\n\tpublic url?: string;\n\n\t/**\n\t * The embed color\n\t */\n\tpublic color?: number;\n\n\t/**\n\t * The timestamp of the embed in the ISO format\n\t */\n\tpublic timestamp?: string;\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic thumbnail?: APIEmbedThumbnail;\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic image?: APIEmbedImage;\n\n\t/**\n\t * Received video data\n\t */\n\tpublic video?: APIEmbedVideo;\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic author?: APIEmbedAuthor;\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic provider?: APIEmbedProvider;\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic footer?: APIEmbedFooter;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.title = data.title;\n\t\tthis.description = data.description;\n\t\tthis.url = data.url;\n\t\tthis.color = data.color;\n\t\tthis.thumbnail = data.thumbnail;\n\t\tthis.image = data.image;\n\t\tthis.video = data.video;\n\t\tthis.author = data.author;\n\t\tthis.provider = data.provider;\n\t\tthis.footer = data.footer;\n\t\tthis.fields = data.fields ?? [];\n\n\t\tif (data.timestamp) this.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.title?.length ?? 0) +\n\t\t\t(this.description?.length ?? 0) +\n\t\t\tthis.fields.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) +\n\t\t\t(this.footer?.text.length ?? 0) +\n\t\t\t(this.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * Adds a field to the embed (max 25)\n\t *\n\t * @param field The field to add.\n\t */\n\tpublic addField(field: APIEmbedField): this {\n\t\treturn this.addFields(field);\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: APIEmbedField[]): this {\n\t\t// Data assertions\n\t\tembedFieldsArrayPredicate.parse(fields);\n\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(this.fields, fields.length);\n\n\t\tthis.fields.push(...Embed.normalizeFields(...fields));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Data assertions\n\t\tembedFieldsArrayPredicate.parse(fields);\n\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(this.fields, fields.length - deleteCount);\n\n\t\tthis.fields.splice(index, deleteCount, ...Embed.normalizeFields(...fields));\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\tpublic setAuthor(options: AuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst { name, iconURL, url } = options;\n\t\t// Data assertions\n\t\tauthorNamePredicate.parse(name);\n\t\turlPredicate.parse(iconURL);\n\t\turlPredicate.parse(url);\n\n\t\tthis.author = { name, url, icon_url: iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | null): this {\n\t\t// Data assertions\n\t\tcolorPredicate.parse(color);\n\n\t\tthis.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\tdescriptionPredicate.parse(description);\n\n\t\tthis.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: FooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst { text, iconURL } = options;\n\t\t// Data assertions\n\t\tfooterTextPredicate.parse(text);\n\t\turlPredicate.parse(iconURL);\n\n\t\tthis.footer = { text, icon_url: iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\t// Data assertions\n\t\turlPredicate.parse(url);\n\n\t\tthis.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\turlPredicate.parse(url);\n\n\t\tthis.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\ttimestampPredicate.parse(timestamp);\n\n\t\tthis.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\ttitlePredicate.parse(title);\n\n\t\tthis.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\t// Data assertions\n\t\turlPredicate.parse(url);\n\n\t\tthis.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this };\n\t}\n\n\t/**\n\t * Normalizes field input and resolves strings\n\t *\n\t * @param fields Fields to normalize\n\t */\n\tpublic static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[] {\n\t\treturn fields.flat(Infinity).map((field) => {\n\t\t\tfieldNamePredicate.parse(field.name);\n\t\t\tfieldValuePredicate.parse(field.value);\n\t\t\tfieldInlinePredicate.parse(field.inline);\n\n\t\t\treturn { name: field.name, value: field.value, inline: field.inline ?? undefined };\n\t\t});\n\t}\n}\n","import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @param content The content to wrap\n */\nexport function codeBlock(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @param language The language for the codeblock\n * @param content The content to wrap\n */\nexport function codeBlock(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code\n *\n * @param content The content to wrap\n */\nexport function inlineCode(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text\n *\n * @param content The content to wrap\n */\nexport function italic(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text\n *\n * @param content The content to wrap\n */\nexport function bold(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text\n *\n * @param content The content to wrap\n */\nexport function underscore(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text\n *\n * @param content The content to wrap\n */\nexport function strikethrough(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function quote(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function blockQuote(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text)\n *\n * @param content The content to wrap\n */\nexport function spoiler(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention\n *\n * @param userId The user ID to format\n */\nexport function userMention(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention\n *\n * @param memberId The user ID to format\n */\nexport function memberNicknameMention(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention\n *\n * @param channelId The channel ID to format\n */\nexport function channelMention(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention\n *\n * @param roleId The role ID to format\n */\nexport function roleMention(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n */\nexport function formatEmoji(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji(emojiId: C, animated?: true): ``;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji(emojiId: C, animated = false): `` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string\n *\n * @param date The date to format, defaults to the current time\n */\nexport function time(date?: Date): ``;\n\n/**\n * Formats a date given a format style\n *\n * @param date The date to format\n * @param style The style to use\n */\nexport function time(date: Date, style: S): ``;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n */\nexport function time(seconds: C): ``;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n * @param style The style to use\n */\nexport function time(seconds: C, style: S): ``;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `` : ``;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n","import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^[\\P{Lu}\\p{N}_-]+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst descriptionPredicate = z.string().min(1).max(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tdescriptionPredicate.parse(description);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateRequired(required: unknown): asserts required is boolean {\n\tbooleanPredicate.parse(required);\n}\n\nconst maxArrayLengthPredicate = z.unknown().array().max(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tmaxArrayLengthPredicate.parse(options);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tmaxArrayLengthPredicate.parse(choices);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n","import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport {\n\tassertReturnOfBuilder,\n\tvalidateDefaultPermission,\n\tvalidateMaxOptionsLength,\n\tvalidateRequiredParameters,\n} from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t *\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON(): APIApplicationCommandOption;\n}\n","import { APIApplicationCommandBooleanOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandBooleanOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic toJSON(): APIApplicationCommandBooleanOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n","import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { validateRequiredParameters, validateRequired } from '../Assertions';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {\n\tpublic abstract readonly type: ApplicationCommandOptionType;\n\n\tpublic readonly required = false;\n\n\t/**\n\t * Marks the option as required\n\t *\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(required);\n\n\t\tReflect.set(this, 'required', required);\n\n\t\treturn this;\n\t}\n\n\tpublic abstract toJSON(): APIApplicationCommandBasicOption;\n\n\tprotected runRequiredValidations() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(this.required);\n\t}\n}\n","import { APIApplicationCommandChannelOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin';\n\n@mix(ApplicationCommandOptionChannelTypesMixin)\nexport class SlashCommandChannelOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic toJSON(): APIApplicationCommandChannelOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {}\n","import { ChannelType } from 'discord-api-types/v9';\nimport { z, ZodLiteral } from 'zod';\n\n// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)\nconst allowedChannelTypes = [\n\tChannelType.GuildText,\n\tChannelType.GuildVoice,\n\tChannelType.GuildCategory,\n\tChannelType.GuildNews,\n\tChannelType.GuildStore,\n\tChannelType.GuildNewsThread,\n\tChannelType.GuildPublicThread,\n\tChannelType.GuildPrivateThread,\n\tChannelType.GuildStageVoice,\n] as const;\n\nexport type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];\n\nconst channelTypePredicate = z.union(\n\tallowedChannelTypes.map((type) => z.literal(type)) as [\n\t\tZodLiteral,\n\t\tZodLiteral,\n\t\t...ZodLiteral[]\n\t],\n);\n\nexport class ApplicationCommandOptionChannelTypesMixin {\n\tpublic readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];\n\n\t/**\n\t * Adds a channel type to this option\n\t *\n\t * @param channelType The type of channel to allow\n\t */\n\tpublic addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes) {\n\t\tif (this.channel_types === undefined) {\n\t\t\tReflect.set(this, 'channel_types', []);\n\t\t}\n\n\t\tchannelTypePredicate.parse(channelType);\n\t\tthis.channel_types!.push(channelType);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds channel types to this option\n\t *\n\t * @param channelTypes The channel types to add\n\t */\n\tpublic addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]) {\n\t\tchannelTypes.forEach((channelType) => this.addChannelType(channelType));\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().int().nonnegative();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandIntegerOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'maxValue', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'minValue', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandIntegerOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandIntegerOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin {}\n","export abstract class ApplicationCommandNumericOptionMinMaxValueMixin {\n\tprotected readonly maxValue?: number;\n\tprotected readonly minValue?: number;\n\n\t/**\n\t * Sets the maximum number value of this option\n\t * @param max The maximum value this option can be\n\t */\n\tpublic abstract setMaxValue(max: number): this;\n\n\t/**\n\t * Sets the minimum number value of this option\n\t * @param min The minimum value this option can be\n\t */\n\tpublic abstract setMinValue(min: number): this;\n}\n","import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport { validateMaxChoicesLength } from '../Assertions';\n\nconst stringPredicate = z.string().min(1).max(100);\nconst numberPredicate = z.number().gt(-Infinity).lt(Infinity);\nconst choicesPredicate = z.tuple([stringPredicate, z.union([stringPredicate, numberPredicate])]).array();\nconst booleanPredicate = z.boolean();\n\nexport class ApplicationCommandOptionWithChoicesAndAutocompleteMixin {\n\tpublic readonly choices?: APIApplicationCommandOptionChoice[];\n\tpublic readonly autocomplete?: boolean;\n\n\t// Since this is present and this is a mixin, this is needed\n\tpublic readonly type!: ApplicationCommandOptionType;\n\n\t/**\n\t * Adds a choice for this option\n\t *\n\t * @param name The name of the choice\n\t * @param value The value of the choice\n\t */\n\tpublic addChoice(name: string, value: T): Omit {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tif (this.choices === undefined) {\n\t\t\tReflect.set(this, 'choices', []);\n\t\t}\n\n\t\tvalidateMaxChoicesLength(this.choices!);\n\n\t\t// Validate name\n\t\tstringPredicate.parse(name);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) {\n\t\t\tstringPredicate.parse(value);\n\t\t} else {\n\t\t\tnumberPredicate.parse(value);\n\t\t}\n\n\t\tthis.choices!.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t *\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(choices: [name: string, value: T][]): Omit {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tfor (const [label, value] of choices) this.addChoice(label, value);\n\t\treturn this;\n\t}\n\n\tpublic setChoices(\n\t\tchoices: Input,\n\t): Input extends []\n\t\t? this & Pick, 'setAutocomplete'>\n\t\t: Omit {\n\t\tif (choices.length > 0 && this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tReflect.set(this, 'choices', []);\n\t\tfor (const [label, value] of choices) this.addChoice(label, value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Marks the option as autocompletable\n\t * @param autocomplete If this option should be autocompletable\n\t */\n\tpublic setAutocomplete(\n\t\tautocomplete: U,\n\t): U extends true\n\t\t? Omit\n\t\t: this & Pick, 'addChoice' | 'addChoices'> {\n\t\t// Assert that you actually passed a boolean\n\t\tbooleanPredicate.parse(autocomplete);\n\n\t\tif (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tReflect.set(this, 'autocomplete', autocomplete);\n\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandMentionableOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandMentionableOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic toJSON(): APIApplicationCommandMentionableOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().nonnegative();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandNumberOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'maxValue', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'minValue', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandNumberOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandNumberOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin {}\n","import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin {}\n","import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandNumberOption } from '../options/number';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput:\n\t\t\t| SlashCommandStringOption\n\t\t\t| Omit\n\t\t\t| Omit\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandStringOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandStringOption\n\t\t\t\t\t| Omit\n\t\t\t\t\t| Omit),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput:\n\t\t\t| SlashCommandIntegerOption\n\t\t\t| Omit\n\t\t\t| Omit\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandIntegerOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandIntegerOption\n\t\t\t\t\t| Omit\n\t\t\t\t\t| Omit),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\t/**\n\t * Adds a number option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addNumberOption(\n\t\tinput:\n\t\t\t| SlashCommandNumberOption\n\t\t\t| Omit\n\t\t\t| Omit\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandNumberOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandNumberOption\n\t\t\t\t\t| Omit\n\t\t\t\t\t| Omit),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandNumberOption);\n\t}\n\n\tprivate _sharedAddOptionMethod(\n\t\tinput:\n\t\t\t| T\n\t\t\t| Omit\n\t\t\t| Omit\n\t\t\t| ((builder: T) => T | Omit | Omit),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n","import {\n\tAPIApplicationCommandSubcommandGroupOption,\n\tAPIApplicationCommandSubcommandOption,\n\tApplicationCommandOptionType,\n} from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: SlashCommandSubcommandBuilder[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandSubcommandGroupOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ApplicationCommandOptionBase[] = [];\n\n\tpublic toJSON(): APIApplicationCommandSubcommandOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n","import { z } from 'zod';\nimport { ApplicationCommandType } from 'discord-api-types/v9';\nimport type { ContextMenuCommandType } from './ContextMenuCommandBuilder';\n\nexport function validateRequiredParameters(name: string, type: number) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert type is valid\n\tvalidateType(type);\n}\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^( *[\\p{L}\\p{N}_-]+ *)+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]);\n\nexport function validateType(type: unknown): asserts type is ContextMenuCommandType {\n\ttypePredicate.parse(type);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n","import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';\nimport type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\n\nexport class ContextMenuCommandBuilder {\n\t/**\n\t * The name of this context menu command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The type of this context menu command\n\t */\n\tpublic readonly type: ContextMenuCommandType = undefined!;\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the type\n\t *\n\t * @param type The type\n\t */\n\tpublic setType(type: ContextMenuCommandType) {\n\t\t// Assert the type is valid\n\t\tvalidateType(type);\n\n\t\tReflect.set(this, 'type', type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.type);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n}\n\nexport type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;\n"],"mappings":"w9BAAA,+0BCAA,wXACA,MAAkB,eAEL,EAAqB,IAAE,SAAS,IAAI,GAAG,IAAI,KAE3C,EAAsB,IAAE,SAAS,IAAI,GAAG,IAAI,MAE5C,EAAuB,IAAE,UAAU,WAEnC,GAAsB,IAAE,OAAO,CAC3C,KAAM,EACN,MAAO,EACP,OAAQ,IAGI,EAA4B,GAAoB,QAEhD,GAAuB,IAAE,SAAS,IAAI,IAE5C,WAA6B,EAAyB,EAA4B,CACxF,GAAqB,MAAM,EAAO,OAAS,GAGrC,GAAM,GAAsB,EAAmB,WAEzC,EAAe,IAAE,SAAS,MAAM,UAEhC,EAAiB,IAAE,SAAS,IAAI,GAAG,IAAI,UAAU,WAEjD,EAAuB,IAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAEnD,EAAsB,IAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAElD,GAAqB,IAAE,MAAM,CAAC,IAAE,SAAU,IAAE,SAAS,WAErD,GAAiB,EAAmB,WCI1C,WAAgC,CA6D/B,YAAY,EAAiB,GAAI,CAzDjC,iBAKA,gBAKA,sBAKA,cAKA,gBAKA,oBAKA,oBAKA,gBAKA,gBAKA,iBAKA,mBAKA,iBAGN,KAAK,MAAQ,EAAK,MAClB,KAAK,YAAc,EAAK,YACxB,KAAK,IAAM,EAAK,IAChB,KAAK,MAAQ,EAAK,MAClB,KAAK,UAAY,EAAK,UACtB,KAAK,MAAQ,EAAK,MAClB,KAAK,MAAQ,EAAK,MAClB,KAAK,OAAS,EAAK,OACnB,KAAK,SAAW,EAAK,SACrB,KAAK,OAAS,EAAK,OACnB,KAAK,OAAS,EAAK,QAAU,GAEzB,EAAK,WAAW,MAAK,UAAY,GAAI,MAAK,EAAK,WAAW,kBAMpD,SAAiB,CAC3B,MACE,MAAK,OAAO,QAAU,GACtB,MAAK,aAAa,QAAU,GAC7B,KAAK,OAAO,OAAO,CAAC,EAAM,IAAS,EAAO,EAAK,KAAK,OAAS,EAAK,MAAM,OAAQ,GAC/E,MAAK,QAAQ,KAAK,QAAU,GAC5B,MAAK,QAAQ,KAAK,QAAU,GASxB,SAAS,EAA4B,CAC3C,MAAO,MAAK,UAAU,GAQhB,aAAa,EAA+B,CAElD,SAA0B,MAAM,GAGhC,EAAoB,KAAK,OAAQ,EAAO,QAExC,KAAK,OAAO,KAAK,GAAG,EAAM,gBAAgB,GAAG,IACtC,KAUD,aAAa,EAAe,KAAwB,EAA+B,CAEzF,SAA0B,MAAM,GAGhC,EAAoB,KAAK,OAAQ,EAAO,OAAS,GAEjD,KAAK,OAAO,OAAO,EAAO,EAAa,GAAG,EAAM,gBAAgB,GAAG,IAC5D,KAQD,UAAU,EAAqC,CACrD,GAAI,IAAY,KACf,YAAK,OAAS,OACP,KAGR,GAAM,CAAE,OAAM,UAAS,OAAQ,EAE/B,SAAoB,MAAM,GAC1B,EAAa,MAAM,GACnB,EAAa,MAAM,GAEnB,KAAK,OAAS,CAAE,OAAM,MAAK,SAAU,GAC9B,KAQD,SAAS,EAA4B,CAE3C,SAAe,MAAM,GAErB,KAAK,MAAQ,GAAS,OACf,KAQD,eAAe,EAAkC,CAEvD,SAAqB,MAAM,GAE3B,KAAK,YAAc,GAAe,OAC3B,KAQD,UAAU,EAAqC,CACrD,GAAI,IAAY,KACf,YAAK,OAAS,OACP,KAGR,GAAM,CAAE,OAAM,WAAY,EAE1B,SAAoB,MAAM,GAC1B,EAAa,MAAM,GAEnB,KAAK,OAAS,CAAE,OAAM,SAAU,GACzB,KAQD,SAAS,EAA0B,CAEzC,SAAa,MAAM,GAEnB,KAAK,MAAQ,EAAM,CAAE,OAAQ,OACtB,KAQD,aAAa,EAA0B,CAE7C,SAAa,MAAM,GAEnB,KAAK,UAAY,EAAM,CAAE,OAAQ,OAC1B,KAQD,aAAa,EAAkC,KAAK,MAAa,CAEvE,UAAmB,MAAM,GAEzB,KAAK,UAAY,EAAY,GAAI,MAAK,GAAW,cAAgB,OAC1D,KAQD,SAAS,EAA4B,CAE3C,UAAe,MAAM,GAErB,KAAK,MAAQ,GAAS,OACf,KAQD,OAAO,EAA0B,CAEvC,SAAa,MAAM,GAEnB,KAAK,IAAM,GAAO,OACX,KAMD,QAAmB,CACzB,MAAO,IAAK,YAQC,oBAAmB,EAA0C,CAC1E,MAAO,GAAO,KAAK,KAAU,IAAI,AAAC,GACjC,GAAmB,MAAM,EAAM,MAC/B,EAAoB,MAAM,EAAM,OAChC,EAAqB,MAAM,EAAM,QAE1B,CAAE,KAAM,EAAM,KAAM,MAAO,EAAM,MAAO,OAAQ,EAAM,QAAU,YCjTnE,YAAmB,EAAkB,EAA0B,CACrE,MAAO,OAAO,IAAY,YAAc;AAAA,EAAW,UAAmB,SAAS;AAAA,EAAa,UAQtF,YAAsC,EAAwB,CACpE,MAAO,KAAK,MAQN,YAAkC,EAAsB,CAC9D,MAAO,IAAI,KAQL,YAAgC,EAAwB,CAC9D,MAAO,KAAK,MAQN,YAAsC,EAAwB,CACpE,MAAO,KAAK,MAQN,YAAyC,EAAwB,CACvE,MAAO,KAAK,MAQN,YAAiC,EAAsB,CAC7D,MAAO,KAAK,IAQN,YAAsC,EAAwB,CACpE,MAAO,OAAO,IAgBR,YAAuB,EAAmB,CAEhD,MAAO,IAAI,KA4CL,YAAmB,EAAiB,EAAmB,EAAgB,CAE7E,MAAO,GAAQ,IAAI,MAAY,MAAQ,MAAY,IAAI,MAAY,KAQ7D,YAAmC,EAAwB,CACjE,MAAO,KAAK,MAQN,YAA0C,EAAsB,CACtE,MAAO,KAAK,KAQN,YAAoD,EAAyB,CACnF,MAAO,MAAM,KAQP,YAA6C,EAAyB,CAC5E,MAAO,KAAK,KAQN,YAA0C,EAAuB,CACvE,MAAO,MAAM,KAwBP,YAA0C,EAAY,EAAW,GAAmC,CAC1G,MAAO,IAAI,EAAW,IAAM,QAAQ,KAgC9B,YAAc,EAA+B,EAAuC,CAC1F,MAAI,OAAO,IAAkB,UAC5B,GAAgB,KAAK,MAAO,IAAe,WAAa,KAAK,OAAS,MAGhE,MAAO,IAAU,SAAW,MAAM,KAAiB,KAAW,MAAM,KAMrE,GAAM,IAAkB,CAI9B,UAAW,IAKX,SAAU,IAKV,UAAW,IAKX,SAAU,IAKV,cAAe,IAKf,aAAc,IAKd,aAAc,KAWH,GAAL,CAAK,GAIX,SAAQ,0BAKR,YAAY,6DAKZ,SAAS,kDAdE,YC/SZ,mPAAA,MAAe,gCAEf,EAAkB,eAKX,WACN,EACA,EACA,EACC,CAED,EAAa,GAGb,EAAoB,GAGpB,EAAyB,GAG1B,GAAM,IAAgB,IACpB,SACA,IAAI,GACJ,IAAI,IACJ,MAAM,uBAED,WAAsB,EAAuC,CACnE,GAAc,MAAM,GAGrB,GAAM,IAAuB,IAAE,SAAS,IAAI,GAAG,IAAI,KAE5C,WAA6B,EAAqD,CACxF,GAAqB,MAAM,GAG5B,GAAM,IAAmB,IAAE,UAEpB,YAAmC,EAA0C,CACnF,GAAiB,MAAM,GAGjB,WAA0B,EAAgD,CAChF,GAAiB,MAAM,GAGxB,GAAM,IAA0B,IAAE,UAAU,QAAQ,IAAI,IAEjD,WAAkC,EAAuE,CAC/G,GAAwB,MAAM,GAGxB,YAAkC,EAA8C,CACtF,GAAwB,MAAM,GAGxB,WAEL,EAAgB,EAAqD,CACtE,GAAM,GAAe,EAAmB,KAExC,GAAI,UAAG,gBAAgB,GACtB,KAAM,IAAI,WACT,yBAAyB,kBAA6B,IAAU,KAAO,OAAS,wBAIlF,GAAI,UAAG,UAAU,GAChB,KAAM,IAAI,WAAU,yBAAyB,+BAA0C,MAAO,gBAG/F,GAAI,CAAE,aAAiB,IAAqB,CAC3C,GAAM,GAAS,EAET,EAAkB,UAAG,UAAU,GAAS,EAAM,KAAO,EAAO,YAAY,KACxE,EAAY,QAAQ,IAAI,EAAQ,OAAO,aAEvC,EAAiB,EAAY,GAAG,MAAoB,KAAe,EAEzE,KAAM,IAAI,WAAU,yBAAyB,kBAA6B,eChF5E,OAAoB,oBCDpB,OAAiF,gCCE1E,WAA+B,CAA/B,aAFP,CAGiB,eACA,sBAOT,QAAQ,EAAc,CAE5B,SAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAQD,eAAe,EAAqB,CAE1C,SAAoB,GAEpB,QAAQ,IAAI,KAAM,cAAe,GAE1B,OC3BF,mBAAoD,EAAyB,CAA7E,aAJP,CAIO,oBAGU,kBAAW,IAOpB,YAAY,EAAmB,CAErC,SAAiB,GAEjB,QAAQ,IAAI,KAAM,WAAY,GAEvB,KAKE,wBAAyB,CAClC,EAA2B,KAAK,KAAM,KAAK,YAAa,IAGxD,EAAiB,KAAK,YF1BjB,mBAAwC,EAA6B,CAArE,aAHP,CAGO,oBACU,cAAO,gCAA6B,SAE7C,QAA6C,CACnD,YAAK,yBAEE,IAAK,QGTd,OAAiF,gCACjF,GAAoB,oBCDpB,MAA4B,gCAC5B,GAA8B,eAGxB,GAAsB,CAC3B,cAAY,UACZ,cAAY,WACZ,cAAY,cACZ,cAAY,UACZ,cAAY,WACZ,cAAY,gBACZ,cAAY,kBACZ,cAAY,mBACZ,cAAY,iBAKP,GAAuB,KAAE,MAC9B,GAAoB,IAAI,AAAC,GAAS,KAAE,QAAQ,KAOtC,QAAgD,CAAhD,aA1BP,CA2BiB,wBAOT,eAAe,EAA0D,CAC/E,MAAI,MAAK,gBAAkB,QAC1B,QAAQ,IAAI,KAAM,gBAAiB,IAGpC,GAAqB,MAAM,GAC3B,KAAK,cAAe,KAAK,GAElB,KAQD,gBAAgB,EAA6D,CACnF,SAAa,QAAQ,AAAC,GAAgB,KAAK,eAAe,IACnD,OD9CF,mBAAwC,EAA6B,CAArE,aANP,CAMO,oBACmB,cAAO,gCAA6B,SAEtD,QAA6C,CACnD,YAAK,yBAEE,IAAK,QANP,KADN,WAAI,KACE,GENP,OAAiF,gCACjF,GAAoB,oBACpB,GAAkB,eCFX,WAA+D,CAA/D,aAAP,CACoB,mBACA,qBCFpB,OAAgF,gCAChF,EAAkB,eAGlB,GAAM,GAAkB,IAAE,SAAS,IAAI,GAAG,IAAI,KACxC,GAAkB,IAAE,SAAS,GAAG,MAAW,GAAG,KAC9C,GAAmB,IAAE,MAAM,CAAC,EAAiB,IAAE,MAAM,CAAC,EAAiB,OAAoB,QAC3F,GAAmB,IAAE,UAEpB,OAAyF,CAAzF,aATP,CAUiB,kBACA,uBAGA,eAQT,UAAU,EAAc,EAAyC,CACvE,GAAI,KAAK,aACR,KAAM,IAAI,YAAW,kEAGtB,MAAI,MAAK,UAAY,QACpB,QAAQ,IAAI,KAAM,UAAW,IAG9B,GAAyB,KAAK,SAG9B,EAAgB,MAAM,GAGtB,AAAI,KAAK,OAAS,gCAA6B,OAC9C,EAAgB,MAAM,GAEtB,GAAgB,MAAM,GAGvB,KAAK,QAAS,KAAK,CAAE,OAAM,UAEpB,KAQD,WAAW,EAAoE,CACrF,GAAI,KAAK,aACR,KAAM,IAAI,YAAW,kEAGtB,GAAiB,MAAM,GAEvB,OAAW,CAAC,EAAO,IAAU,GAAS,KAAK,UAAU,EAAO,GAC5D,MAAO,MAGD,WACN,EAGgC,CAChC,GAAI,EAAQ,OAAS,GAAK,KAAK,aAC9B,KAAM,IAAI,YAAW,kEAGtB,GAAiB,MAAM,GAEvB,QAAQ,IAAI,KAAM,UAAW,IAC7B,OAAW,CAAC,EAAO,IAAU,GAAS,KAAK,UAAU,EAAO,GAE5D,MAAO,MAOD,gBACN,EAGsG,CAItG,GAFA,GAAiB,MAAM,GAEnB,GAAgB,MAAM,QAAQ,KAAK,UAAY,KAAK,QAAQ,OAAS,EACxE,KAAM,IAAI,YAAW,kEAGtB,eAAQ,IAAI,KAAM,eAAgB,GAE3B,OF5FT,GAAM,IAAkB,KAAE,SAAS,MAAM,cAGlC,eACE,EAET,CAHO,aAVP,CAUO,oBAIU,cAAO,gCAA6B,SAE7C,YAAY,EAAmB,CACrC,UAAgB,MAAM,GAEtB,QAAQ,IAAI,KAAM,WAAY,GAEvB,KAGD,YAAY,EAAmB,CACrC,UAAgB,MAAM,GAEtB,QAAQ,IAAI,KAAM,WAAY,GAEvB,KAGD,QAA6C,CAGnD,GAFA,KAAK,yBAED,KAAK,cAAgB,MAAM,QAAQ,KAAK,UAAY,KAAK,QAAQ,OAAS,EAC7E,KAAM,IAAI,YAAW,kEAGtB,MAAO,IAAK,QA7BP,KADN,WAAI,EAAiD,IAC/C,GGVP,OAAqF,gCAG9E,mBAA4C,EAA6B,CAAzE,aAHP,CAGO,oBACU,cAAO,gCAA6B,aAE7C,QAAiD,CACvD,YAAK,yBAEE,IAAK,QCTd,OAAgF,gCAChF,GAAoB,oBACpB,GAAkB,eAKlB,GAAM,IAAkB,KAAE,SAAS,cAG5B,eACE,EAET,CAHO,aAVP,CAUO,oBAIU,cAAO,gCAA6B,QAE7C,YAAY,EAAmB,CACrC,UAAgB,MAAM,GAEtB,QAAQ,IAAI,KAAM,WAAY,GAEvB,KAGD,YAAY,EAAmB,CACrC,UAAgB,MAAM,GAEtB,QAAQ,IAAI,KAAM,WAAY,GAEvB,KAGD,QAA4C,CAGlD,GAFA,KAAK,yBAED,KAAK,cAAgB,MAAM,QAAQ,KAAK,UAAY,KAAK,QAAQ,OAAS,EAC7E,KAAM,IAAI,YAAW,kEAGtB,MAAO,IAAK,QA7BP,KADN,WAAI,EAAiD,IAC/C,GCVP,OAA8E,gCAGvE,mBAAqC,EAA6B,CAAlE,aAHP,CAGO,oBACmB,cAAO,gCAA6B,MAEtD,QAA0C,CAChD,YAAK,yBAEE,IAAK,QCTd,OAAgF,gCAChF,GAAoB,oBAKb,mBAAuC,EAA6B,CAApE,aANP,CAMO,oBACU,cAAO,gCAA6B,QAE7C,QAA4C,CAGlD,GAFA,KAAK,yBAED,KAAK,cAAgB,MAAM,QAAQ,KAAK,UAAY,KAAK,QAAQ,OAAS,EAC7E,KAAM,IAAI,YAAW,kEAGtB,MAAO,IAAK,QAVP,KADN,WAAI,IACE,GCNP,OAA8E,gCAGvE,mBAAqC,EAA6B,CAAlE,aAHP,CAGO,oBACU,cAAO,gCAA6B,MAE7C,QAA0C,CAChD,YAAK,yBAEE,IAAK,QCGP,WAAsE,CAAtE,aAZP,CAaiB,kBAOT,iBACN,EACC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAQpC,cAAc,EAA+F,CACnH,MAAO,MAAK,uBAAuB,EAAO,GAQpC,iBACN,EACC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAQpC,cAAc,EAA+F,CACnH,MAAO,MAAK,uBAAuB,EAAO,GAQpC,qBACN,EACC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAQpC,gBACN,EAUC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAQpC,iBACN,EAUC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAQpC,gBACN,EAUC,CACD,MAAO,MAAK,uBAAuB,EAAO,GAGnC,uBACP,EAKA,EACyG,CACzG,GAAM,CAAE,WAAY,KAGpB,EAAyB,GAGzB,GAAM,GAAS,MAAO,IAAU,WAAa,EAAM,GAAI,IAAc,EAErE,SAAsB,EAAQ,GAG9B,EAAQ,KAAK,GAEN,OCnJT,OAIO,gCACP,GAAoB,oBAab,WAAmF,CAAnF,aAlBP,CAsBiB,eAKA,sBAKA,iBAA2C,IAOpD,cACN,EAGC,CACD,GAAM,CAAE,WAAY,KAGpB,EAAyB,GAGzB,GAAM,GAAS,MAAO,IAAU,WAAa,EAAM,GAAI,IAAmC,EAE1F,SAAsB,EAAQ,GAG9B,EAAQ,KAAK,GAEN,KAGD,QAAqD,CAC3D,SAA2B,KAAK,KAAM,KAAK,YAAa,KAAK,SAEtD,CACN,KAAM,gCAA6B,gBACnC,KAAM,KAAK,KACX,YAAa,KAAK,YAClB,QAAS,KAAK,QAAQ,IAAI,AAAC,GAAW,EAAO,aAjDzC,KADN,WAAI,IACE,GA8DA,WAA8E,CAA9E,aAhFP,CAoFiB,eAKA,sBAKA,iBAA0C,IAEnD,QAAgD,CACtD,SAA2B,KAAK,KAAM,KAAK,YAAa,KAAK,SAEtD,CACN,KAAM,gCAA6B,WACnC,KAAM,KAAK,KACX,YAAa,KAAK,YAClB,QAAS,KAAK,QAAQ,IAAI,AAAC,GAAW,EAAO,aAvBzC,KADN,WAAI,EAA0B,IACxB,GfnEA,WAA0B,CAA1B,aAbP,CAiBiB,eAKA,sBAKA,iBAA4C,IAO5C,4BAOT,QAAiD,CACvD,SAA2B,KAAK,KAAM,KAAK,YAAa,KAAK,SAEtD,CACN,KAAM,KAAK,KACX,YAAa,KAAK,YAClB,QAAS,KAAK,QAAQ,IAAI,AAAC,GAAW,EAAO,UAC7C,mBAAoB,KAAK,mBAapB,qBAAqB,EAAgB,CAE3C,UAA0B,GAE1B,QAAQ,IAAI,KAAM,oBAAqB,GAEhC,KAQD,mBACN,EAGqC,CACrC,GAAM,CAAE,WAAY,KAGpB,EAAyB,GAGzB,GAAM,GAAS,MAAO,IAAU,WAAa,EAAM,GAAI,IAAwC,EAE/F,SAAsB,EAAQ,GAG9B,EAAQ,KAAK,GAEN,KAQD,cACN,EAGqC,CACrC,GAAM,CAAE,WAAY,KAGpB,EAAyB,GAGzB,GAAM,GAAS,MAAO,IAAU,WAAa,EAAM,GAAI,IAAmC,EAE1F,SAAsB,EAAQ,GAG9B,EAAQ,KAAK,GAEN,OA1GF,KADN,WAAI,EAA2B,IACzB,GgBbP,2HAAA,MAAkB,eAClB,GAAuC,gCAGhC,YAAoC,EAAc,EAAc,CAEtE,EAAa,GAGb,EAAa,GAGd,GAAM,IAAgB,IACpB,SACA,IAAI,GACJ,IAAI,IACJ,MAAM,6BAED,WAAsB,EAAuC,CACnE,GAAc,MAAM,GAGrB,GAAM,IAAgB,IAAE,MAAM,CAAC,IAAE,QAAQ,0BAAuB,MAAO,IAAE,QAAQ,0BAAuB,WAEjG,WAAsB,EAAuD,CACnF,GAAc,MAAM,GAGrB,GAAM,IAAmB,IAAE,UAEpB,YAAmC,EAA0C,CACnF,GAAiB,MAAM,GC5BjB,YAAgC,CAAhC,aAHP,CAOiB,eAKA,eAOA,4BAOT,QAAQ,EAAc,CAE5B,SAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAQD,QAAQ,EAA8B,CAE5C,SAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAYD,qBAAqB,EAAgB,CAE3C,UAA0B,GAE1B,QAAQ,IAAI,KAAM,oBAAqB,GAEhC,KAQD,QAAiD,CACvD,UAA2B,KAAK,KAAM,KAAK,MACpC,CACN,KAAM,KAAK,KACX,KAAM,KAAK,KACX,mBAAoB,KAAK","names":[]}
\ No newline at end of file
+{"version":3,"sources":["../src/index.ts","../src/messages/embed/Assertions.ts","../src/util/validation.ts","../src/util/normalizeArray.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/components/Assertions.ts","../src/components/selectMenu/SelectMenuOption.ts","../src/components/ActionRow.ts","../src/components/Component.ts","../src/components/Components.ts","../src/components/button/Button.ts","../src/components/selectMenu/SelectMenu.ts","../src/components/textInput/TextInput.ts","../src/components/textInput/Assertions.ts","../src/util/jsonEncodable.ts","../src/interactions/modals/Assertions.ts","../src/interactions/modals/Modal.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/options/attachment.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts","../src/util/equatable.ts","../src/util/componentUtil.ts"],"sourcesContent":["export * as EmbedAssertions from './messages/embed/Assertions';\nexport * from './messages/embed/Embed';\nexport * from './messages/formatters';\n\nexport * as ComponentAssertions from './components/Assertions';\nexport * from './components/ActionRow';\nexport * from './components/button/Button';\nexport * from './components/Component';\nexport * from './components/Components';\nexport * from './components/textInput/TextInput';\nexport * as TextInputAssertions from './components/textInput/Assertions';\nexport * from './interactions/modals/Modal';\nexport * as ModalAssertions from './interactions/modals/Assertions';\nexport * from './components/selectMenu/SelectMenu';\nexport * from './components/selectMenu/SelectMenuOption';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/number';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/attachment';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\nexport * from './interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nexport * from './interactions/slashCommands/mixins/ApplicationCommandOptionBase';\nexport * from './interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin';\nexport * from './interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\nexport * from './interactions/slashCommands/mixins/NameAndDescription';\nexport * from './interactions/slashCommands/mixins/SharedSlashCommandOptions';\n\nexport * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';\nexport * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';\n\nexport * from './util/jsonEncodable';\nexport * from './util/equatable';\nexport * from './util/componentUtil';\nexport * from './util/normalizeArray';\nexport * from './util/validation';\n","import { s } from '@sapphire/shapeshift';\nimport type { APIEmbedField } from 'discord-api-types/v10';\nimport { isValidationEnabled } from '../../util/validation';\n\nexport const fieldNamePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(256)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldValuePredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(1024)\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const fieldInlinePredicate = s.boolean.optional;\n\nexport const embedFieldPredicate = s\n\t.object({\n\t\tname: fieldNamePredicate,\n\t\tvalue: fieldValuePredicate,\n\t\tinline: fieldInlinePredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array.setValidationEnabled(isValidationEnabled);\n\nexport const fieldLengthPredicate = s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const imageURLPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:', 'attachment:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const urlPredicate = s.string\n\t.url({\n\t\tallowedProtocols: ['http:', 'https:'],\n\t})\n\t.nullish.setValidationEnabled(isValidationEnabled);\n\nexport const embedAuthorPredicate = s\n\t.object({\n\t\tname: authorNamePredicate,\n\t\ticonURL: imageURLPredicate,\n\t\turl: urlPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const RGBPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(255)\n\t.setValidationEnabled(isValidationEnabled);\nexport const colorPredicate = s.number.int\n\t.greaterThanOrEqual(0)\n\t.lessThanOrEqual(0xffffff)\n\t.or(s.tuple([RGBPredicate, RGBPredicate, RGBPredicate]))\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const descriptionPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(4096)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const footerTextPredicate = s.string\n\t.lengthGreaterThanOrEqual(1)\n\t.lengthLessThanOrEqual(2048)\n\t.nullable.setValidationEnabled(isValidationEnabled);\n\nexport const embedFooterPredicate = s\n\t.object({\n\t\ttext: footerTextPredicate,\n\t\ticonURL: imageURLPredicate,\n\t})\n\t.setValidationEnabled(isValidationEnabled);\n\nexport const timestampPredicate = s.union(s.number, s.date).nullable.setValidationEnabled(isValidationEnabled);\n\nexport const titlePredicate = fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);\n","let validate = true;\n\nexport const enableValidators = () => (validate = true);\nexport const disableValidators = () => (validate = false);\nexport const isValidationEnabled = () => validate;\n","export function normalizeArray(arr: RestOrArray): T[] {\n\tif (Array.isArray(arr[0])) return arr[0];\n\treturn arr as T[];\n}\n\nexport type RestOrArray = T[] | [T[]];\n","import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage } from 'discord-api-types/v10';\nimport {\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedAuthorPredicate,\n\tembedFieldsArrayPredicate,\n\tembedFooterPredicate,\n\timageURLPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { normalizeArray, type RestOrArray } from '../../util/normalizeArray';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit & IconData;\n\nexport type EmbedAuthorOptions = Omit;\n\nexport type EmbedFooterData = Omit