Crab moment

This commit is contained in:
Helixu 2021-11-22 20:07:00 +00:00
parent 618c069385
commit 542b6b5bae
755 changed files with 31187 additions and 4801 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
.token
token.json

3
devs.json Normal file
View file

@ -0,0 +1,3 @@
{
"devlist": ["831598877320413244"]
}

108
index.js
View file

@ -1,2 +1,108 @@
const dc = require("discord.js");
const client = new dc.Client({Intents: ["GUILDS"]});
const client = new dc.Client({intents: ["GUILDS"]});
const fs = require("fs");
client.login(JSON.parse(fs.readFileSync("token.json").toString())["token"]);
function readJson(path){
return JSON.parse(fs.readFileSync(path).toString());
}
function writeJson(path, content){
fs.writeFileSync(path, JSON.stringify(content));
}
function getUserCount(){
var yes = 0;
client.guilds.cache.forEach(guild => {
guild.members.cache.forEach(mem => {
yes++;
});
});
return yes;
}
var int;
function startLoop(){
try {
clearInterval(int);
int = setInterval(()=>{
//console.log("Ayup");
client.user.setActivity("over " + getUserCount() + " people", {type: "WATCHING"});
},5000);
} catch(e){console.log(e)}
}
function stopLoop(){
try {
clearInterval(int);
} catch(e){}
}
client.on("ready", () => {
startLoop();
console.log("I'm alive");
client.guilds.cache.get("879081086817288264").commands.set([
{
name: "ping",
description: "Am alive???"
},
{
name: "activity",
description: "Sets funny activity",
options: [
{
name: "type",
description: "The type, for example playing or watching or listening or streaming or competing.",
type: 3,
required: true
},
{
name: "activity",
description: "What you want it to say",
type: 3,
required: false
}
]
},
{
name: "eval",
description: "Evaluation of JS",
options: [
{
name: "code",
description: "Code to exec",
type: 3
}
]
}
]).then(cmds => {
console.log("Finished loading all commands");
});
});
client.on("interactionCreate", (int) => {
if(int.isCommand()){
if(int.commandName == "ping"){
int.reply(`Yup, I'm alive (${client.ws.ping} ms)`);
} else if(int.commandName == "activity"){
var devs = readJson("devs.json");
if(!devs.devlist.includes(int.user.id)) return int.reply("You shall not pass");
if(int.options.getString("activity") !== null){
stopLoop();
client.user.setActivity(int.options.getString("activity"), {type: int.options.getString("type")});
int.reply("Stopped activity loop, and switched to custom set status.");
} else {
startLoop();
int.reply("Resat activity, and started activity loop.");
}
} else if(int.commandName == "eval"){
var devs = readJson("devs.json");
if(!devs.devlist.includes(int.user.id)) return int.reply("You shall not pass");
try{
int.reply(new String(eval(int.options.getString("code"))).valueOf()).catch(e => {});
} catch(e){
int.reply(e.stack).catch(e => {});
};
}
}
});

69
node_modules/.package-lock.json generated vendored
View file

@ -5,25 +5,33 @@
"requires": true,
"packages": {
"node_modules/@discordjs/builders": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.8.2.tgz",
"integrity": "sha512-/YRd11SrcluqXkKppq/FAVzLIPRVlIVmc6X8ZklspzMIHDtJ+A4W37D43SHvLdH//+NnK+SHW/WeOF4Ts54PeQ==",
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"discord-api-types": "^0.24.0",
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"engines": {
"node": ">=16.0.0",
"node": ">=14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/collection": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.3.2.tgz",
"integrity": "sha512-dMjLl60b2DMqObbH1MQZKePgWhsNe49XkKBZ0W5Acl5uVV43SN414i2QfZwRI7dXAqIn8pEWD2+XXQFn9KWxqg==",
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.4.tgz",
"integrity": "sha512-PVrEJH+V6Ob0OwfagYQ/57kwt/HNEJxt5jqY4P+S3st9y29t9iokdnGMQoJXG5VEMAQIPbzu9Snw1F6yE8PdLA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
@ -67,15 +75,6 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.9.tgz",
"integrity": "sha512-MKmdASMf3LtPzwLyRrFjtFFZ48cMf8jmX5VRYrDQiJa8Ybu5VAmkqBWqKU8fdCwD8ysw4mQ9nrEHvzg6gunR7A=="
},
"node_modules/@types/node-fetch": {
"version": "2.5.12",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz",
"integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==",
"dependencies": {
"@types/node": "*",
"form-data": "^3.0.0"
}
},
"node_modules/@types/ws": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
@ -117,25 +116,24 @@
}
},
"node_modules/discord-api-types": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz",
"integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==",
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/discord.js": {
"version": "13.3.1",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.3.1.tgz",
"integrity": "sha512-zn4G8tL5+tMV00+0aSsVYNYcIfMSdT2g0nudKny+Ikd+XKv7m6bqI7n3Vji0GIRqXDr5ArPaw+iYFM2I1Iw3vg==",
"version": "13.2.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
"dependencies": {
"@discordjs/builders": "^0.8.1",
"@discordjs/collection": "^0.3.2",
"@discordjs/builders": "^0.6.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"@sapphire/async-queue": "^1.1.8",
"@types/node-fetch": "^2.5.12",
"@sapphire/async-queue": "^1.1.5",
"@types/ws": "^8.2.0",
"discord-api-types": "^0.24.0",
"discord-api-types": "^0.23.1",
"node-fetch": "^2.6.1",
"ws": "^8.2.3"
},
@ -158,19 +156,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",

View file

@ -175,7 +175,6 @@
END OF TERMS AND CONDITIONS
Copyright 2021 Noel Buechler
Copyright 2021 Vlad Frangu
Licensed under the Apache License, Version 2.0 (the "License");

View file

@ -6,48 +6,28 @@
<br />
<p>
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
<a href="https://www.npmjs.com/package/@discordjs/builders"><img src="https://img.shields.io/npm/v/@discordjs/builders.svg?maxAge=3600" alt="NPM version" /></a>
<a href="https://www.npmjs.com/package/@discordjs/builders"><img src="https://img.shields.io/npm/dt/@discordjs/builders.svg?maxAge=3600" alt="NPM downloads" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Tests/badge.svg" alt="Build status" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Tests/badge.svg" alt="Test status" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Lint/badge.svg" alt="Lint status" /></a>
<a href="https://codecov.io/gh/discordjs/builders"><img src="https://codecov.io/gh/discordjs/builders/branch/main/graph/badge.svg" alt="Code coverage" /></a>
</p>
</div>
## Installation
**Node.js 16.6.0 or newer is required.**
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh-session
```sh
npm install @discordjs/builders
yarn add @discordjs/builders
pnpm add @discordjs/builders
```
## Contribution
See [Contributing Guide](https://github.com/discordjs/builders/blob/main/.github/CONTRIBUTING.md).
## Examples
Here are some examples for the builders and utilities you can find in this package:
- [Slash Command Builders](./docs/examples/Slash%20Command%20Builders.md)
## Links
- [Website](https://discord.js.org/) ([source](https://github.com/discordjs/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)
- [NPM](https://www.npmjs.com/package/@discordjs/builders)
- [Related libraries](https://discord.com/developers/docs/topics/community-resources#libraries)
## Contributing
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.
## Help
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle
nudge in the right direction, please don't hesitate to join our official [discord.js Server](https://discord.gg/djs).

View file

@ -1,818 +1,15 @@
import * as ow from 'ow';
import * as discord_api_types_v9 from 'discord-api-types/v9';
import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, ApplicationCommandOptionType, ChannelType, APIApplicationCommandChannelOptions, APIApplicationCommandOptionChoice, APIApplicationCommandSubCommandOptions, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
import { Snowflake } from 'discord-api-types/globals';
import { URL } from 'url';
declare const fieldNamePredicate: ow.StringPredicate;
declare const fieldValuePredicate: ow.StringPredicate;
declare const fieldInlinePredicate: ow.BooleanPredicate & ow.BasePredicate<boolean | undefined>;
declare const embedFieldPredicate: ow.ObjectPredicate<{
name: string;
value: string;
inline: boolean | undefined;
}>;
declare const embedFieldsArrayPredicate: ow.ArrayPredicate<{
name: string;
value: string;
inline: boolean | undefined;
}>;
declare function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void;
declare const authorNamePredicate: ow.AnyPredicate<string | null>;
declare const urlPredicate: ow.AnyPredicate<string | null | undefined>;
declare const colorPredicate: ow.AnyPredicate<number | null>;
declare const descriptionPredicate: ow.AnyPredicate<string | null>;
declare const footerTextPredicate: ow.AnyPredicate<string | null>;
declare const timestampPredicate: ow.AnyPredicate<number | Date | null>;
declare const titlePredicate: ow.AnyPredicate<string | null>;
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_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 {
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_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,
};
}
interface AuthorOptions {
name: string;
url?: string;
iconURL?: string;
}
interface FooterOptions {
text: string;
iconURL?: string;
}
/**
* Represents an 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;
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;
/**
* Removes, replaces, or inserts fields in the embed (max 25)
*
* @param index The index to start at
* @param deleteCount The number of fields to remove
* @param fields The replacing field objects
*/
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
/**
* Sets the author of this embed
*
* @param options The options for the author
*/
setAuthor(options: AuthorOptions | null): this;
/**
* Sets the color of this embed
*
* @param color The color of the embed
*/
setColor(color: number | null): this;
/**
* Sets the description of this embed
*
* @param description The description
*/
setDescription(description: string | null): this;
/**
* Sets the footer of this embed
*
* @param options The options for the footer
*/
setFooter(options: FooterOptions | null): this;
/**
* Sets the image of this embed
*
* @param url The URL of the image
*/
setImage(url: string | null): this;
/**
* Sets the thumbnail of this embed
*
* @param url The URL of the thumbnail
*/
setThumbnail(url: string | null): this;
/**
* Sets the timestamp of this embed
*
* @param timestamp The timestamp or date
*/
setTimestamp(timestamp?: number | Date | null): this;
/**
* Sets the title of this embed
*
* @param title The title
*/
setTitle(title: string | null): this;
/**
* Sets the URL of this embed
*
* @param url The URL
*/
setURL(url: string | null): this;
/**
* 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
*/
declare function codeBlock<C extends string>(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
*/
declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
/**
* Wraps the content inside \`backticks\`, which formats it as inline code
*
* @param content The content to wrap
*/
declare function inlineCode<C extends string>(content: C): `\`${C}\``;
/**
* Formats the content into italic text
*
* @param content The content to wrap
*/
declare function italic<C extends string>(content: C): `_${C}_`;
/**
* Formats the content into bold text
*
* @param content The content to wrap
*/
declare function bold<C extends string>(content: C): `**${C}**`;
/**
* Formats the content into underscored text
*
* @param content The content to wrap
*/
declare function underscore<C extends string>(content: C): `__${C}__`;
/**
* Formats the content into strike-through text
*
* @param content The content to wrap
*/
declare function strikethrough<C extends string>(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
*/
declare function quote<C extends string>(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
*/
declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
/**
* Wraps the URL into `<>`, which stops it from embedding
*
* @param url The URL to wrap
*/
declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
/**
* Wraps the URL into `<>`, which stops it from embedding
*
* @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
*/
declare function hyperlink<C extends string>(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
*/
declare function hyperlink<C extends string, U extends string>(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
*/
declare function hyperlink<C extends string, T extends string>(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
*/
declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
/**
* Wraps the content inside spoiler (hidden text)
*
* @param content The content to wrap
*/
declare function spoiler<C extends string>(content: C): `||${C}||`;
/**
* Formats a user ID into a user mention
*
* @param userId The user ID to format
*/
declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
/**
* Formats a user ID into a member-nickname mention
*
* @param memberId The user ID to format
*/
declare function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>`;
/**
* Formats a channel ID into a channel mention
*
* @param channelId The channel ID to format
*/
declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
/**
* Formats a role ID into a role mention
*
* @param roleId The role ID to format
*/
declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
/**
* Formats an emoji ID into a fully qualified emoji identifier
*
* @param emojiId The emoji ID to format
*/
declare function formatEmoji<C extends Snowflake>(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`
*/
declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
/**
* Formats a date into a short date-time string
*
* @param date The date to format, defaults to the current time
*/
declare function time(date?: Date): `<t:${bigint}>`;
/**
* Formats a date given a format style
*
* @param date The date to format
* @param style The style to use
*/
declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
/**
* Formats the given timestamp into a short date-time string
*
* @param seconds The time to format, represents an UNIX timestamp in seconds
*/
declare function time<C extends number>(seconds: C): `<t:${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
*/
declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
/**
* The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord
*/
declare const TimestampStyles: {
/**
* Short time format, consisting of hours and minutes, e.g. 16:20
*/
readonly ShortTime: "t";
/**
* Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30
*/
readonly LongTime: "T";
/**
* Short date format, consisting of day, month, and year, e.g. 20/04/2021
*/
readonly ShortDate: "d";
/**
* Long date format, consisting of day, month, and year, e.g. 20 April 2021
*/
readonly LongDate: "D";
/**
* Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20
*/
readonly ShortDateTime: "f";
/**
* Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20
*/
readonly LongDateTime: "F";
/**
* Relative time format, consisting of a relative duration format, e.g. 2 months ago
*/
readonly RelativeTime: "R";
};
/**
* The possible values, see {@link TimestampStyles} for more information
*/
declare type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];
/**
* An enum with all the available faces from Discord's native slash commands
*/
declare enum Faces {
/**
* ¯\\_()\\_/¯
*/
Shrug = "\u00AF\\_(\u30C4)\\_/\u00AF",
/**
* (°°
*/
Tableflip = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B",
/**
* ( -)
*/
Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"
}
declare class SlashCommandBooleanOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Boolean;
constructor();
}
declare abstract class ApplicationCommandOptionWithChannelTypesBase extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
channelTypes?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
/**
* Adds a channel type to this option
*
* @param channelType The type of channel to allow
*/
addChannelType(channelType: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>): this;
/**
* Adds channel types to this option
*
* @param channelTypes The channel types to add
*/
addChannelTypes(channelTypes: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[]): this;
toJSON(): APIApplicationCommandChannelOptions;
}
declare class SlashCommandChannelOption extends ApplicationCommandOptionWithChannelTypesBase {
readonly type: ApplicationCommandOptionType.Channel;
constructor();
}
declare abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number> extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
choices?: APIApplicationCommandOptionChoice[];
/**
* 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): this;
/**
* Adds multiple choices for this option
*
* @param choices The choices to add
*/
addChoices(choices: [name: string, value: T][]): this;
toJSON(): {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
name: string;
description: string;
default?: boolean | undefined;
required?: boolean | undefined;
} | {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
options?: discord_api_types_v9.APIApplicationCommandOption[] | undefined;
name: string;
description: string;
default?: boolean | undefined;
required?: boolean | undefined;
} | {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType.Channel;
channel_types?: (discord_api_types_v9.ChannelType.GuildText | discord_api_types_v9.ChannelType.GuildVoice | discord_api_types_v9.ChannelType.GuildCategory | discord_api_types_v9.ChannelType.GuildNews | discord_api_types_v9.ChannelType.GuildStore | discord_api_types_v9.ChannelType.GuildNewsThread | discord_api_types_v9.ChannelType.GuildPublicThread | discord_api_types_v9.ChannelType.GuildPrivateThread | discord_api_types_v9.ChannelType.GuildStageVoice)[] | undefined;
name: string;
description: string;
default?: boolean | undefined;
required?: boolean | undefined;
} | {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType.Boolean | ApplicationCommandOptionType.User | ApplicationCommandOptionType.Role | ApplicationCommandOptionType.Mentionable;
name: string;
description: string;
default?: boolean | undefined;
required?: boolean | undefined;
};
}
declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {
readonly type: ApplicationCommandOptionType.Integer;
constructor();
}
declare class SlashCommandMentionableOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Mentionable;
constructor();
}
declare class SlashCommandNumberOption extends ApplicationCommandOptionWithChoicesBase<number> {
readonly type: ApplicationCommandOptionType.Number;
constructor();
}
declare class SlashCommandRoleOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Role;
constructor();
}
declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {
readonly type: ApplicationCommandOptionType.String;
constructor();
}
declare class SlashCommandUserOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.User;
constructor();
}
declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a boolean option
*
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a user option
*
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a channel option
*
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a role option
*
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a mentionable option
*
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a string option
*
* @param input A function that returns an option builder, or an already built builder
*/
addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds an integer option
*
* @param input A function that returns an option builder, or an already built builder
*/
addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a number option
*
* @param input A function that returns an option builder, or an already built builder
*/
addNumberOption(input: SlashCommandNumberOption | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
private _sharedAddOptionMethod;
}
declare class SharedNameAndDescription {
readonly name: string;
readonly description: string;
/**
* Sets the name
*
* @param name The name
*/
setName(name: string): this;
/**
* Sets the description
*
* @param description The description
*/
setDescription(description: string): this;
}
/**
* Represents a folder for subcommands
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand group
*/
readonly name: string;
/**
* The description of this subcommand group
*/
readonly description: string;
/**
* The subcommands part of this subcommand group
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a new subcommand to this group
*
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
toJSON(): APIApplicationCommandSubCommandOptions;
}
interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
}
/**
* Represents a subcommand
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand
*/
readonly name: string;
/**
* The description of this subcommand
*/
readonly description: string;
/**
* The options of this subcommand
*/
readonly options: ToAPIApplicationCommandOptions[];
toJSON(): APIApplicationCommandSubCommandOptions;
}
interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {
}
declare class SlashCommandBuilder {
/**
* The name of this slash command
*/
readonly name: string;
/**
* The description of this slash command
*/
readonly description: string;
/**
* The options of this slash command
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Whether the command is enabled by default when the app is added to a guild
*
* @default true
*/
readonly defaultPermission: boolean | undefined;
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON(): RESTPostAPIApplicationCommandsJSONBody;
/**
* Sets whether the command is enabled by default when the application is added to a guild.
*
* **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
*
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
*/
setDefaultPermission(value: boolean): this;
/**
* Adds a new subcommand group to this command
*
* @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
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
}
interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {
}
interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {
}
interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick<SlashCommandBuilder, 'toJSON'> {
}
interface ToAPIApplicationCommandOptions {
toJSON(): APIApplicationCommandOption;
}
declare class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {
required: boolean;
readonly type: ApplicationCommandOptionType;
constructor(type: ApplicationCommandOptionType);
/**
* Marks the option as required
*
* @param required If this option should be required
*/
setRequired(required: boolean): this;
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 validateDefaultPermission$1(value: unknown): asserts value is boolean;
declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
declare function assertReturnOfBuilder<T extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
declare const Assertions$1_validateDescription: typeof validateDescription;
declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
declare const Assertions$1_validateMaxChoicesLength: typeof validateMaxChoicesLength;
declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
declare namespace Assertions$1 {
export {
validateRequiredParameters$1 as validateRequiredParameters,
validateName$1 as validateName,
Assertions$1_validateDescription as validateDescription,
validateDefaultPermission$1 as validateDefaultPermission,
Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
Assertions$1_validateMaxChoicesLength as validateMaxChoicesLength,
Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
};
}
declare class ContextMenuCommandBuilder {
/**
* The name of this context menu command
*/
readonly name: string;
/**
* The type of this context menu command
*/
readonly type: ContextMenuCommandType;
/**
* Whether the command is enabled by default when the app is added to a guild
*
* @default true
*/
readonly defaultPermission: boolean | undefined;
/**
* Sets the name
*
* @param name The name
*/
setName(name: string): this;
/**
* Sets the type
*
* @param type The type
*/
setType(type: ContextMenuCommandType): this;
/**
* Sets whether the command is enabled by default when the application is added to a guild.
*
* **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
*
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
*/
setDefaultPermission(value: boolean): this;
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON(): RESTPostAPIApplicationCommandsJSONBody;
}
declare type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;
declare function validateRequiredParameters(name: string, type: number): void;
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 const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
declare const Assertions_validateName: typeof validateName;
declare const Assertions_validateType: typeof validateType;
declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
declare namespace Assertions {
export {
Assertions_validateRequiredParameters as validateRequiredParameters,
Assertions_validateName as validateName,
Assertions_validateType as validateType,
Assertions_validateDefaultPermission as validateDefaultPermission,
};
}
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 };
export * as EmbedAssertions from './messages/embed/Assertions';
export * from './messages/embed/Embed';
export * from './messages/formatters';
export * as SlashCommandAssertions from './interactions/slashCommands/Assertions';
export * from './interactions/slashCommands/SlashCommandBuilder';
export * from './interactions/slashCommands/SlashCommandSubcommands';
export * from './interactions/slashCommands/options/boolean';
export * from './interactions/slashCommands/options/channel';
export * from './interactions/slashCommands/options/integer';
export * from './interactions/slashCommands/options/mentionable';
export * from './interactions/slashCommands/options/number';
export * from './interactions/slashCommands/options/role';
export * from './interactions/slashCommands/options/string';
export * from './interactions/slashCommands/options/user';
//# sourceMappingURL=index.d.ts.map

1
node_modules/@discordjs/builders/dist/index.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAEtC,OAAO,KAAK,sBAAsB,MAAM,yCAAyC,CAAC;AAClF,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,12 @@
import type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';
import type { SlashCommandOptionBase } from './mixins/CommandOptionBase';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
export declare function validateRequiredParameters(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
export declare function validateName(name: unknown): asserts name is string;
export declare function validateDescription(description: unknown): asserts description is string;
export declare function validateDefaultPermission(value: unknown): asserts value is boolean;
export declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
export declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
export declare function assertReturnOfBuilder<T extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
//# sourceMappingURL=Assertions.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"Assertions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/Assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,8BAA8B,EAAE,QAUzC;AAUD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAElE;AAID,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAEvF;AAID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAElF;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,8BAA8B,EAAE,CAE9G;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iCAAiC,EAAE,QAEpF;AAED,wBAAgB,qBAAqB,CACpC,CAAC,SAAS,sBAAsB,GAAG,6BAA6B,GAAG,kCAAkC,EACpG,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAuBrE"}

View file

@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertReturnOfBuilder = exports.validateMaxChoicesLength = exports.validateMaxOptionsLength = exports.validateDefaultPermission = exports.validateDescription = exports.validateName = exports.validateRequiredParameters = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const ow_1 = tslib_1.__importDefault(require("ow"));
function validateRequiredParameters(name, description, options) {
// Assert name matches all conditions
validateName(name);
// Assert description conditions
validateDescription(description);
// Assert options conditions
validateMaxOptionsLength(options);
}
exports.validateRequiredParameters = validateRequiredParameters;
const namePredicate = ow_1.default.string.lowercase
.minLength(1)
.maxLength(32)
.addValidator({
message: (value, label) => `Expected ${label} to match "^[\\p{L}\\p{N}_-]+$", got ${value} instead`,
validator: (value) => /^[\p{L}\p{N}_-]+$/u.test(value),
});
function validateName(name) {
ow_1.default(name, 'name', namePredicate);
}
exports.validateName = validateName;
const descriptionPredicate = ow_1.default.string.minLength(1).maxLength(100);
function validateDescription(description) {
ow_1.default(description, 'description', descriptionPredicate);
}
exports.validateDescription = validateDescription;
const defaultPermissionPredicate = ow_1.default.boolean;
function validateDefaultPermission(value) {
ow_1.default(value, 'default_permission', defaultPermissionPredicate);
}
exports.validateDefaultPermission = validateDefaultPermission;
const maxArrayLengthPredicate = ow_1.default.array.maxLength(25);
function validateMaxOptionsLength(options) {
ow_1.default(options, 'options', maxArrayLengthPredicate);
}
exports.validateMaxOptionsLength = validateMaxOptionsLength;
function validateMaxChoicesLength(choices) {
ow_1.default(choices, 'choices', maxArrayLengthPredicate);
}
exports.validateMaxChoicesLength = validateMaxChoicesLength;
function assertReturnOfBuilder(input, ExpectedInstanceOf) {
const instanceName = ExpectedInstanceOf.name;
if (is_1.default.nullOrUndefined(input)) {
throw new TypeError(`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`);
}
if (is_1.default.primitive(input)) {
throw new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);
}
if (!(input instanceof ExpectedInstanceOf)) {
const casted = input;
const constructorName = is_1.default.function_(input) ? input.name : casted.constructor.name;
const stringTag = Reflect.get(casted, Symbol.toStringTag);
const fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;
throw new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);
}
}
exports.assertReturnOfBuilder = assertReturnOfBuilder;
//# sourceMappingURL=Assertions.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,63 @@
import type { APIApplicationCommandOption } from 'discord-api-types/v9';
import { SharedSlashCommandOptions } from './mixins/CommandOptions';
import { SharedNameAndDescription } from './mixins/NameAndDescription';
import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
export declare class SlashCommandBuilder {
/**
* The name of this slash command
*/
readonly name: string;
/**
* The description of this slash command
*/
readonly description: string;
/**
* The options of this slash command
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Whether the command is enabled by default when the app is added to a guild
* @default true
*/
readonly defaultPermission: boolean | undefined;
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON(): {
name: string;
description: string;
options: APIApplicationCommandOption[];
default_permission: boolean | undefined;
};
/**
* Sets whether the command is enabled by default when the application is added to a guild.
*
* **Note**: If set to `false`, you will have to later have to `PUT` the permissions for this command.
* @param value Whether or not to enable this command by default
*
* @see https://discord.com/developers/docs/interactions/slash-commands#permissions
*/
setDefaultPermission(value: boolean): this;
/**
* Adds a new subcommand group to this command
* @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
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
}
export interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {
}
export interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {
}
export interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick<SlashCommandBuilder, 'toJSON'> {
}
export interface ToAPIApplicationCommandOptions {
toJSON(): APIApplicationCommandOption;
}
//# sourceMappingURL=SlashCommandBuilder.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"SlashCommandBuilder.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAQxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAE9G,qBACa,mBAAmB;IAC/B;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;OAGG;IACH,SAAgB,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAAa;IAEnE;;;;OAIG;IACI,MAAM;;;;;;IAUb;;;;;;;OAOG;IACI,oBAAoB,CAAC,KAAK,EAAE,OAAO;IAS1C;;;OAGG;IACI,kBAAkB,CACxB,KAAK,EACF,kCAAkC,GAClC,CAAC,CAAC,eAAe,EAAE,kCAAkC,KAAK,kCAAkC,CAAC,GAC9F,kCAAkC;IAiBrC;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC,GACpF,kCAAkC;CAgBrC;AAED,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB,EAAE,yBAAyB;CAAG;AAEnG,MAAM,WAAW,kCAChB,SAAQ,wBAAwB,EAC/B,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,eAAe,GAAG,oBAAoB,CAAC;CAAG;AAEjF,MAAM,WAAW,8BAChB,SAAQ,wBAAwB,EAC/B,yBAAyB,EACzB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;CAAG;AAExC,MAAM,WAAW,8BAA8B;IAC9C,MAAM,IAAI,2BAA2B,CAAC;CACtC"}

View file

@ -0,0 +1,113 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandBuilder = void 0;
const tslib_1 = require("tslib");
const ts_mixer_1 = require("ts-mixer");
const Assertions_1 = require("./Assertions");
const CommandOptions_1 = require("./mixins/CommandOptions");
const NameAndDescription_1 = require("./mixins/NameAndDescription");
const SlashCommandSubcommands_1 = require("./SlashCommandSubcommands");
let SlashCommandBuilder = class SlashCommandBuilder {
constructor() {
/**
* The name of this slash command
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this slash command
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The options of this slash command
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
/**
* Whether the command is enabled by default when the app is added to a guild
* @default true
*/
Object.defineProperty(this, "defaultPermission", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
}
/**
* Returns the final data that should be sent to Discord.
*
* **Note:** Calling this function will validate required properties based on their conditions.
*/
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
default_permission: this.defaultPermission,
};
}
/**
* Sets whether the command is enabled by default when the application is added to a guild.
*
* **Note**: If set to `false`, you will have to later have to `PUT` the permissions for this command.
* @param value Whether or not to enable this command by default
*
* @see https://discord.com/developers/docs/interactions/slash-commands#permissions
*/
setDefaultPermission(value) {
// Assert the value matches the conditions
Assertions_1.validateDefaultPermission(value);
Reflect.set(this, 'defaultPermission', value);
return this;
}
/**
* Adds a new subcommand group to this command
* @param input A function that returns a subcommand group builder, or an already built builder
*/
addSubcommandGroup(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder);
// Push it
options.push(result);
return this;
}
/**
* Adds a new subcommand to this command
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandBuilder);
// Push it
options.push(result);
return this;
}
};
SlashCommandBuilder = tslib_1.__decorate([
ts_mixer_1.mix(CommandOptions_1.SharedSlashCommandOptions, NameAndDescription_1.SharedNameAndDescription)
], SlashCommandBuilder);
exports.SlashCommandBuilder = SlashCommandBuilder;
//# sourceMappingURL=SlashCommandBuilder.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,64 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SharedSlashCommandOptions } from './mixins/CommandOptions';
import { SharedNameAndDescription } from './mixins/NameAndDescription';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
/**
* Represents a folder for subcommands
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
export declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand group
*/
readonly name: string;
/**
* The description of this subcommand group
*/
readonly description: string;
/**
* The subcommands part of this subcommand group
*/
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a new subcommand to this group
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
options: import("discord-api-types/v9").APIApplicationCommandOption[];
};
}
export interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
}
/**
* Represents a subcommand
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
export declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
/**
* The name of this subcommand
*/
readonly name: string;
/**
* The description of this subcommand
*/
readonly description: string;
/**
* The options of this subcommand
*/
readonly options: ToAPIApplicationCommandOptions[];
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
options: import("discord-api-types/v9").APIApplicationCommandOption[];
};
}
export interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {
}
//# sourceMappingURL=SlashCommandSubcommands.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"SlashCommandSubcommands.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandSubcommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E;;;;GAIG;AACH,qBACa,kCAAmC,YAAW,8BAA8B;IACxF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAkBhF,MAAM;;;;;;CASb;AAED,MAAM,WAAW,kCAAmC,SAAQ,wBAAwB;CAAG;AAEvF;;;;GAIG;AACH,qBACa,6BAA8B,YAAW,8BAA8B;IACnF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAExD,MAAM;;;;;;CASb;AAED,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,yBAAyB,CAAC,KAAK,CAAC;CAAG"}

View file

@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandSubcommandBuilder = exports.SlashCommandSubcommandGroupBuilder = void 0;
const tslib_1 = require("tslib");
require("discord-api-types/v9");
const ts_mixer_1 = require("ts-mixer");
const Assertions_1 = require("./Assertions");
const CommandOptions_1 = require("./mixins/CommandOptions");
const NameAndDescription_1 = require("./mixins/NameAndDescription");
/**
* Represents a folder for subcommands
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
let SlashCommandSubcommandGroupBuilder = class SlashCommandSubcommandGroupBuilder {
constructor() {
/**
* The name of this subcommand group
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this subcommand group
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The subcommands part of this subcommand group
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
/**
* Adds a new subcommand to this group
* @param input A function that returns a subcommand builder, or an already built builder
*/
addSubcommand(input) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;
Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
// Push it
options.push(result);
return this;
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
type: 2 /* SubcommandGroup */,
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
};
}
};
SlashCommandSubcommandGroupBuilder = tslib_1.__decorate([
ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription)
], SlashCommandSubcommandGroupBuilder);
exports.SlashCommandSubcommandGroupBuilder = SlashCommandSubcommandGroupBuilder;
/**
* Represents a subcommand
*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
*/
let SlashCommandSubcommandBuilder = class SlashCommandSubcommandBuilder {
constructor() {
/**
* The name of this subcommand
*/
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The description of this subcommand
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: undefined
});
/**
* The options of this subcommand
*/
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: []
});
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, this.options);
return {
type: 1 /* Subcommand */,
name: this.name,
description: this.description,
options: this.options.map((option) => option.toJSON()),
};
}
};
SlashCommandSubcommandBuilder = tslib_1.__decorate([
ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription, CommandOptions_1.SharedSlashCommandOptions)
], SlashCommandSubcommandBuilder);
exports.SlashCommandSubcommandBuilder = SlashCommandSubcommandBuilder;
//# sourceMappingURL=SlashCommandSubcommands.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
import type { ApplicationCommandOptionType } from 'discord-api-types/v9';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
import { SharedNameAndDescription } from './NameAndDescription';
export declare class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {
required: boolean;
readonly type: ApplicationCommandOptionType;
constructor(type: ApplicationCommandOptionType);
/**
* Marks the option as required
* @param required If this option should be required
*/
setRequired(required: boolean): this;
toJSON(): {
type: ApplicationCommandOptionType;
name: string;
description: string;
required: boolean;
};
}
//# sourceMappingURL=CommandOptionBase.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"CommandOptionBase.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,sBAAuB,SAAQ,wBAAyB,YAAW,8BAA8B;IACtG,QAAQ,UAAS;IACxB,SAAgB,IAAI,EAAE,4BAA4B,CAAC;gBAEhC,IAAI,EAAE,4BAA4B;IAKrD;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,OAAO;IAS7B,MAAM;;;;;;CAab"}

View file

@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandOptionBase = void 0;
const tslib_1 = require("tslib");
const ow_1 = tslib_1.__importDefault(require("ow"));
const Assertions_1 = require("../Assertions");
const NameAndDescription_1 = require("./NameAndDescription");
class SlashCommandOptionBase extends NameAndDescription_1.SharedNameAndDescription {
constructor(type) {
super();
Object.defineProperty(this, "required", {
enumerable: true,
configurable: true,
writable: true,
value: false
});
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.type = type;
}
/**
* Marks the option as required
* @param required If this option should be required
*/
setRequired(required) {
// Assert that you actually passed a boolean
ow_1.default(required, 'required', ow_1.default.boolean);
this.required = required;
return this;
}
toJSON() {
Assertions_1.validateRequiredParameters(this.name, this.description, []);
// Assert that you actually passed a boolean
ow_1.default(this.required, 'required', ow_1.default.boolean);
return {
type: this.type,
name: this.name,
description: this.description,
required: this.required,
};
}
}
exports.SlashCommandOptionBase = SlashCommandOptionBase;
//# sourceMappingURL=CommandOptionBase.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"CommandOptionBase.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AACpB,8CAA2D;AAE3D,6DAAgE;AAEhE,MAAa,sBAAuB,SAAQ,6CAAwB;IAInE,YAAmB,IAAkC;QACpD,KAAK,EAAE,CAAC;QAJT;;;;mBAAkB,KAAK;WAAC;QACxB;;;;;WAAmD;QAIlD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAiB;QACnC,4CAA4C;QAC5C,YAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAE5D,4CAA4C;QAC5C,YAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAE1C,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC;IACH,CAAC;CACD;AAnCD,wDAmCC","sourcesContent":["import type { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow from 'ow';\nimport { validateRequiredParameters } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {\n\tpublic required = false;\n\tpublic readonly type: ApplicationCommandOptionType;\n\n\tpublic constructor(type: ApplicationCommandOptionType) {\n\t\tsuper();\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Marks the option as required\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\tow(required, 'required', ow.boolean);\n\n\t\tthis.required = required;\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tow(this.required, 'required', ow.boolean);\n\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\trequired: this.required,\n\t\t};\n\t}\n}\n"]}

View file

@ -0,0 +1,25 @@
import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
import { SlashCommandOptionBase } from './CommandOptionBase';
export declare abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number> extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
choices?: APIApplicationCommandOptionChoice[];
/**
* 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): this;
/**
* Adds multiple choices for this option
* @param choices The choices to add
*/
addChoices(choices: [name: string, value: T][]): this;
toJSON(): {
choices: APIApplicationCommandOptionChoice[] | undefined;
type: ApplicationCommandOptionType;
name: string;
description: string;
required: boolean;
};
}
//# sourceMappingURL=CommandOptionWithChoices.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"CommandOptionWithChoices.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGvG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,8BAAsB,uCAAuC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CACtF,SAAQ,sBACR,YAAW,8BAA8B;IAElC,OAAO,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAErD;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAiBvC;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;IAOrC,MAAM;;;;;;;CAMtB"}

View file

@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationCommandOptionWithChoicesBase = void 0;
const tslib_1 = require("tslib");
require("discord-api-types/v9");
const ow_1 = tslib_1.__importDefault(require("ow"));
const Assertions_1 = require("../Assertions");
const CommandOptionBase_1 = require("./CommandOptionBase");
const stringPredicate = ow_1.default.string.minLength(1).maxLength(100);
const integerPredicate = ow_1.default.number.finite;
// TODO: See resolution for sindresorhus/ow#217 in relation to this cast
const choicesPredicate = ow_1.default.array.ofType(ow_1.default.array.exactShape([stringPredicate, ow_1.default.any(ow_1.default.string, integerPredicate)]));
class ApplicationCommandOptionWithChoicesBase extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(...arguments);
Object.defineProperty(this, "choices", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Adds a choice for this option
* @param name The name of the choice
* @param value The value of the choice
*/
addChoice(name, value) {
this.choices ?? (this.choices = []);
Assertions_1.validateMaxChoicesLength(this.choices);
// Validate name
ow_1.default(name, `${ApplicationCommandOptionTypeNames[this.type]} choice name`, stringPredicate);
// Validate the value
if (this.type === 3 /* String */)
ow_1.default(value, 'string choice value', stringPredicate);
else
ow_1.default(value, `${ApplicationCommandOptionTypeNames[this.type]} choice value`, integerPredicate);
this.choices.push({ name, value });
return this;
}
/**
* Adds multiple choices for this option
* @param choices The choices to add
*/
addChoices(choices) {
ow_1.default(choices, `${ApplicationCommandOptionTypeNames[this.type]} choices`, choicesPredicate);
for (const [label, value] of choices)
this.addChoice(label, value);
return this;
}
toJSON() {
return {
...super.toJSON(),
choices: this.choices,
};
}
}
exports.ApplicationCommandOptionWithChoicesBase = ApplicationCommandOptionWithChoicesBase;
const ApplicationCommandOptionTypeNames = {
[1 /* Subcommand */]: 'subcommand',
[2 /* SubcommandGroup */]: 'subcommand group',
[3 /* String */]: 'string',
[4 /* Integer */]: 'integer',
[5 /* Boolean */]: 'boolean',
[6 /* User */]: 'user',
[7 /* Channel */]: 'channel',
[8 /* Role */]: 'role',
[9 /* Mentionable */]: 'mentionable',
[10 /* Number */]: 'number',
};
//# sourceMappingURL=CommandOptionWithChoices.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"CommandOptionWithChoices.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":";;;;AAAA,gCAAuG;AACvG,oDAAmC;AACnC,8CAAyD;AAEzD,2DAA6D;AAE7D,MAAM,eAAe,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,gBAAgB,GAAG,YAAE,CAAC,MAAM,CAAC,MAAM,CAAC;AAE1C,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,YAAE,CAAC,KAAK,CAAC,MAAM,CACvC,YAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,EAAE,gBAAgB,CAA0C,CAAC,CAAC,CACpH,CAAC;AAEF,MAAsB,uCACrB,SAAQ,0CAAsB;IAD/B;;QAIC;;;;;WAAqD;IAyCtD,CAAC;IAvCA;;;;OAIG;IACI,SAAS,CAAC,IAAY,EAAE,KAAQ;QACtC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;QAEpB,qCAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEvC,gBAAgB;QAChB,YAAE,CAAC,IAAI,EAAE,GAAG,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QAEzF,qBAAqB;QACrB,IAAI,IAAI,CAAC,IAAI,mBAAwC;YAAE,YAAE,CAAC,KAAK,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;;YACpG,YAAE,CAAC,KAAK,EAAE,GAAG,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;QAEjG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,OAAmC;QACpD,YAAE,CAAC,OAAO,EAAE,GAAG,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAEzF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACb,CAAC;IAEe,MAAM;QACrB,OAAO;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AA7CD,0FA6CC;AAED,MAAM,iCAAiC,GAAG;IACzC,oBAAyC,EAAE,YAAY;IACvD,yBAA8C,EAAE,kBAAkB;IAClE,gBAAqC,EAAE,QAAQ;IAC/C,iBAAsC,EAAE,SAAS;IACjD,iBAAsC,EAAE,SAAS;IACjD,cAAmC,EAAE,MAAM;IAC3C,iBAAsC,EAAE,SAAS;IACjD,cAAmC,EAAE,MAAM;IAC3C,qBAA0C,EAAE,aAAa;IACzD,iBAAqC,EAAE,QAAQ;CACtC,CAAC","sourcesContent":["import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow, { Predicate } from 'ow';\nimport { validateMaxChoicesLength } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SlashCommandOptionBase } from './CommandOptionBase';\n\nconst stringPredicate = ow.string.minLength(1).maxLength(100);\nconst integerPredicate = ow.number.finite;\n\n// TODO: See resolution for sindresorhus/ow#217 in relation to this cast\nconst choicesPredicate = ow.array.ofType<[string, string | number]>(\n\tow.array.exactShape([stringPredicate, ow.any(ow.string, integerPredicate) as unknown as Predicate<string | number>]),\n);\n\nexport abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number>\n\textends SlashCommandOptionBase\n\timplements ToAPIApplicationCommandOptions\n{\n\tpublic choices?: APIApplicationCommandOptionChoice[];\n\n\t/**\n\t * Adds a choice for this option\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) {\n\t\tthis.choices ??= [];\n\n\t\tvalidateMaxChoicesLength(this.choices);\n\n\t\t// Validate name\n\t\tow(name, `${ApplicationCommandOptionTypeNames[this.type]} choice name`, stringPredicate);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) ow(value, 'string choice value', stringPredicate);\n\t\telse ow(value, `${ApplicationCommandOptionTypeNames[this.type]} choice value`, integerPredicate);\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 * @param choices The choices to add\n\t */\n\tpublic addChoices(choices: [name: string, value: T][]) {\n\t\tow(choices, `${ApplicationCommandOptionTypeNames[this.type]} choices`, choicesPredicate);\n\n\t\tfor (const [label, value] of choices) this.addChoice(label, value);\n\t\treturn this;\n\t}\n\n\tpublic override toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tchoices: this.choices,\n\t\t};\n\t}\n}\n\nconst ApplicationCommandOptionTypeNames = {\n\t[ApplicationCommandOptionType.Subcommand]: 'subcommand',\n\t[ApplicationCommandOptionType.SubcommandGroup]: 'subcommand group',\n\t[ApplicationCommandOptionType.String]: 'string',\n\t[ApplicationCommandOptionType.Integer]: 'integer',\n\t[ApplicationCommandOptionType.Boolean]: 'boolean',\n\t[ApplicationCommandOptionType.User]: 'user',\n\t[ApplicationCommandOptionType.Channel]: 'channel',\n\t[ApplicationCommandOptionType.Role]: 'role',\n\t[ApplicationCommandOptionType.Mentionable]: 'mentionable',\n\t[ApplicationCommandOptionType.Number]: 'number',\n} as const;\n"]}

View file

@ -0,0 +1,54 @@
import { SlashCommandBooleanOption } from '../options/boolean';
import { SlashCommandChannelOption } from '../options/channel';
import { SlashCommandIntegerOption } from '../options/integer';
import { SlashCommandMentionableOption } from '../options/mentionable';
import { SlashCommandNumberOption } from '../options/number';
import { SlashCommandRoleOption } from '../options/role';
import { SlashCommandStringOption } from '../options/string';
import { SlashCommandUserOption } from '../options/user';
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
export declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
readonly options: ToAPIApplicationCommandOptions[];
/**
* Adds a boolean option
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a user option
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a channel option
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a role option
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a mentionable option
* @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, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a string option
* @param input A function that returns an option builder, or an already built builder
*/
addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds an integer option
* @param input A function that returns an option builder, or an already built builder
*/
addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
/**
* Adds a number option
* @param input A function that returns an option builder, or an already built builder
*/
addNumberOption(input: SlashCommandNumberOption | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
private _sharedAddOptionMethod;
}
//# sourceMappingURL=CommandOptions.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"CommandOptions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE7E,qBAAa,yBAAyB,CAAC,6BAA6B,GAAG,IAAI;IAC1E,SAAgB,OAAO,EAAG,8BAA8B,EAAE,CAAC;IAE3D;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,oBAAoB,CAC1B,KAAK,EAAE,6BAA6B,GAAG,CAAC,CAAC,OAAO,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAKnH;;;OAGG;IACI,eAAe,CACrB,KAAK,EAAE,wBAAwB,GAAG,CAAC,CAAC,OAAO,EAAE,wBAAwB,KAAK,wBAAwB,CAAC;IAKpG;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,eAAe,CACrB,KAAK,EAAE,wBAAwB,GAAG,CAAC,CAAC,OAAO,EAAE,wBAAwB,KAAK,wBAAwB,CAAC;IAKpG,OAAO,CAAC,sBAAsB;CAmB9B"}

View file

@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedSlashCommandOptions = void 0;
const Assertions_1 = require("../Assertions");
const boolean_1 = require("../options/boolean");
const channel_1 = require("../options/channel");
const integer_1 = require("../options/integer");
const mentionable_1 = require("../options/mentionable");
const number_1 = require("../options/number");
const role_1 = require("../options/role");
const string_1 = require("../options/string");
const user_1 = require("../options/user");
class SharedSlashCommandOptions {
constructor() {
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Adds a boolean option
* @param input A function that returns an option builder, or an already built builder
*/
addBooleanOption(input) {
return this._sharedAddOptionMethod(input, boolean_1.SlashCommandBooleanOption);
}
/**
* Adds a user option
* @param input A function that returns an option builder, or an already built builder
*/
addUserOption(input) {
return this._sharedAddOptionMethod(input, user_1.SlashCommandUserOption);
}
/**
* Adds a channel option
* @param input A function that returns an option builder, or an already built builder
*/
addChannelOption(input) {
return this._sharedAddOptionMethod(input, channel_1.SlashCommandChannelOption);
}
/**
* Adds a role option
* @param input A function that returns an option builder, or an already built builder
*/
addRoleOption(input) {
return this._sharedAddOptionMethod(input, role_1.SlashCommandRoleOption);
}
/**
* Adds a mentionable option
* @param input A function that returns an option builder, or an already built builder
*/
addMentionableOption(input) {
return this._sharedAddOptionMethod(input, mentionable_1.SlashCommandMentionableOption);
}
/**
* Adds a string option
* @param input A function that returns an option builder, or an already built builder
*/
addStringOption(input) {
return this._sharedAddOptionMethod(input, string_1.SlashCommandStringOption);
}
/**
* Adds an integer option
* @param input A function that returns an option builder, or an already built builder
*/
addIntegerOption(input) {
return this._sharedAddOptionMethod(input, integer_1.SlashCommandIntegerOption);
}
/**
* Adds a number option
* @param input A function that returns an option builder, or an already built builder
*/
addNumberOption(input) {
return this._sharedAddOptionMethod(input, number_1.SlashCommandNumberOption);
}
_sharedAddOptionMethod(input, Instance) {
const { options } = this;
// First, assert options conditions - we cannot have more than 25 options
Assertions_1.validateMaxOptionsLength(options);
// Get the final result
const result = typeof input === 'function' ? input(new Instance()) : input;
Assertions_1.assertReturnOfBuilder(result, Instance);
// Push it
options.push(result);
return this;
}
}
exports.SharedSlashCommandOptions = SharedSlashCommandOptions;
//# sourceMappingURL=CommandOptions.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,15 @@
export declare class SharedNameAndDescription {
readonly name: string;
readonly description: string;
/**
* Sets the name
* @param name The name
*/
setName(name: string): this;
/**
* Sets the description
* @param description The description
*/
setDescription(description: string): this;
}
//# sourceMappingURL=NameAndDescription.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"NameAndDescription.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":"AAEA,qBAAa,wBAAwB;IACpC,SAAgB,IAAI,EAAG,MAAM,CAAC;IAC9B,SAAgB,WAAW,EAAG,MAAM,CAAC;IAErC;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,MAAM;IAS3B;;;OAGG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM;CAQzC"}

View file

@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SharedNameAndDescription = void 0;
const Assertions_1 = require("../Assertions");
class SharedNameAndDescription {
constructor() {
Object.defineProperty(this, "name", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
/**
* Sets the name
* @param name The name
*/
setName(name) {
// Assert the name matches the conditions
Assertions_1.validateName(name);
Reflect.set(this, 'name', name);
return this;
}
/**
* Sets the description
* @param description The description
*/
setDescription(description) {
// Assert the description matches the conditions
Assertions_1.validateDescription(description);
Reflect.set(this, 'description', description);
return this;
}
}
exports.SharedNameAndDescription = SharedNameAndDescription;
//# sourceMappingURL=NameAndDescription.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"NameAndDescription.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":";;;AAAA,8CAAkE;AAElE,MAAa,wBAAwB;IAArC;QACC;;;;;WAA8B;QAC9B;;;;;WAAqC;IA2BtC,CAAC;IAzBA;;;OAGG;IACI,OAAO,CAAC,IAAY;QAC1B,yCAAyC;QACzC,yBAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAAmB;QACxC,gDAAgD;QAChD,gCAAmB,CAAC,WAAW,CAAC,CAAC;QAEjC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA7BD,4DA6BC","sourcesContent":["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 * @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 * @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"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandBooleanOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Boolean;
constructor();
}
//# sourceMappingURL=boolean.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"boolean.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandBooleanOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandBooleanOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(5 /* Boolean */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 5 /* Boolean */
});
}
}
exports.SlashCommandBooleanOption = SlashCommandBooleanOption;
//# sourceMappingURL=boolean.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"boolean.js","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandBooleanOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Boolean);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandChannelOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Channel;
constructor();
}
//# sourceMappingURL=channel.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"channel.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandChannelOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandChannelOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(7 /* Channel */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 7 /* Channel */
});
}
}
exports.SlashCommandChannelOption = SlashCommandChannelOption;
//# sourceMappingURL=channel.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"channel.js","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandChannelOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Channel);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
export declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {
readonly type: ApplicationCommandOptionType.Integer;
constructor();
}
//# sourceMappingURL=integer.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"integer.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,yBAA0B,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC7F,SAAyB,IAAI,uCAAiD;;CAK9E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandIntegerOption = void 0;
require("discord-api-types/v9");
const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
class SlashCommandIntegerOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
constructor() {
super(4 /* Integer */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 4 /* Integer */
});
}
}
exports.SlashCommandIntegerOption = SlashCommandIntegerOption;
//# sourceMappingURL=integer.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"integer.js","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,yBAA0B,SAAQ,kEAA+C;IAG7F;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {\n\tpublic override readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Integer);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandMentionableOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Mentionable;
constructor();
}
//# sourceMappingURL=mentionable.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mentionable.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,6BAA8B,SAAQ,sBAAsB;IACxE,SAAyB,IAAI,2CAAqD;;CAKlF"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandMentionableOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandMentionableOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(9 /* Mentionable */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 9 /* Mentionable */
});
}
}
exports.SlashCommandMentionableOption = SlashCommandMentionableOption;
//# sourceMappingURL=mentionable.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mentionable.js","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,6BAA8B,SAAQ,0CAAsB;IAGxE;QACC,KAAK,qBAA0C,CAAC;QAHjD;;;;mBAAgC,mBAAiD;WAAC;IAIlF,CAAC;CACD;AAND,sEAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandMentionableOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Mentionable);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
export declare class SlashCommandNumberOption extends ApplicationCommandOptionWithChoicesBase<number> {
readonly type: ApplicationCommandOptionType.Number;
constructor();
}
//# sourceMappingURL=number.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"number.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,wBAAyB,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC5F,SAAyB,IAAI,sCAAgD;;CAK7E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandNumberOption = void 0;
require("discord-api-types/v9");
const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
class SlashCommandNumberOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
constructor() {
super(10 /* Number */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 10 /* Number */
});
}
}
exports.SlashCommandNumberOption = SlashCommandNumberOption;
//# sourceMappingURL=number.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"number.js","sourceRoot":"/","sources":["interactions/slashCommands/options/number.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,wBAAyB,SAAQ,kEAA+C;IAG5F;QACC,KAAK,iBAAqC,CAAC;QAH5C;;;;mBAAgC,eAA4C;WAAC;IAI7E,CAAC;CACD;AAND,4DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandNumberOption extends ApplicationCommandOptionWithChoicesBase<number> {\n\tpublic override readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Number);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandRoleOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.Role;
constructor();
}
//# sourceMappingURL=role.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"role.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandRoleOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandRoleOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(8 /* Role */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 8 /* Role */
});
}
}
exports.SlashCommandRoleOption = SlashCommandRoleOption;
//# sourceMappingURL=role.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"role.js","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandRoleOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Role);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';
export declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {
readonly type: ApplicationCommandOptionType.String;
constructor();
}
//# sourceMappingURL=string.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"string.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,wBAAyB,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC5F,SAAyB,IAAI,sCAAgD;;CAK7E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandStringOption = void 0;
require("discord-api-types/v9");
const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices");
class SlashCommandStringOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase {
constructor() {
super(3 /* String */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 3 /* String */
});
}
}
exports.SlashCommandStringOption = SlashCommandStringOption;
//# sourceMappingURL=string.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"string.js","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,wBAAyB,SAAQ,kEAA+C;IAG5F;QACC,KAAK,gBAAqC,CAAC;QAH5C;;;;mBAAgC,cAA4C;WAAC;IAI7E,CAAC;CACD;AAND,4DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {\n\tpublic override readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.String);\n\t}\n}\n"]}

View file

@ -0,0 +1,7 @@
import { ApplicationCommandOptionType } from 'discord-api-types/v9';
import { SlashCommandOptionBase } from '../mixins/CommandOptionBase';
export declare class SlashCommandUserOption extends SlashCommandOptionBase {
readonly type: ApplicationCommandOptionType.User;
constructor();
}
//# sourceMappingURL=user.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"user.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"}

View file

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SlashCommandUserOption = void 0;
require("discord-api-types/v9");
const CommandOptionBase_1 = require("../mixins/CommandOptionBase");
class SlashCommandUserOption extends CommandOptionBase_1.SlashCommandOptionBase {
constructor() {
super(6 /* User */);
Object.defineProperty(this, "type", {
enumerable: true,
configurable: true,
writable: true,
value: 6 /* User */
});
}
}
exports.SlashCommandUserOption = SlashCommandUserOption;
//# sourceMappingURL=user.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"user.js","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandUserOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.User);\n\t}\n}\n"]}

View file

@ -0,0 +1,23 @@
import type { APIEmbedField } from 'discord-api-types/v9';
export declare const fieldNamePredicate: import("ow").StringPredicate;
export declare const fieldValuePredicate: import("ow").StringPredicate;
export declare const fieldInlinePredicate: import("ow").BooleanPredicate & import("ow").BasePredicate<boolean | undefined>;
export declare const embedFieldPredicate: import("ow").ObjectPredicate<{
name: string;
value: string;
inline: boolean | undefined;
}>;
export declare const embedFieldsArrayPredicate: import("ow").ArrayPredicate<{
name: string;
value: string;
inline: boolean | undefined;
}>;
export declare function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void;
export declare const authorNamePredicate: import("ow").AnyPredicate<string | null>;
export declare const urlPredicate: import("ow").AnyPredicate<string | null | undefined>;
export declare const colorPredicate: import("ow").AnyPredicate<number | null>;
export declare const descriptionPredicate: import("ow").AnyPredicate<string | null>;
export declare const footerTextPredicate: import("ow").AnyPredicate<string | null>;
export declare const timestampPredicate: import("ow").AnyPredicate<number | Date | null>;
export declare const titlePredicate: import("ow").AnyPredicate<string | null>;
//# sourceMappingURL=Assertions.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"Assertions.d.ts","sourceRoot":"/","sources":["messages/embed/Assertions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,eAAO,MAAM,kBAAkB,8BAAwC,CAAC;AAExE,eAAO,MAAM,mBAAmB,8BAAyC,CAAC;AAE1E,eAAO,MAAM,oBAAoB,iFAAsB,CAAC;AAExD,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;EAAuC,CAAC;AAE9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAEvF;AAED,eAAO,MAAM,mBAAmB,0CAAsC,CAAC;AAEvE,eAAO,MAAM,YAAY,sDAA4C,CAAC;AAEtE,eAAO,MAAM,cAAc,0CAA6E,CAAC;AAEzG,eAAO,MAAM,oBAAoB,0CAA0D,CAAC;AAE5F,eAAO,MAAM,mBAAmB,0CAA0D,CAAC;AAE3F,eAAO,MAAM,kBAAkB,iDAAsC,CAAC;AAEtE,eAAO,MAAM,cAAc,0CAAsC,CAAC"}

View file

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.titlePredicate = exports.timestampPredicate = exports.footerTextPredicate = exports.descriptionPredicate = exports.colorPredicate = exports.urlPredicate = exports.authorNamePredicate = exports.validateFieldLength = exports.embedFieldsArrayPredicate = exports.embedFieldPredicate = exports.fieldInlinePredicate = exports.fieldValuePredicate = exports.fieldNamePredicate = void 0;
const tslib_1 = require("tslib");
const ow_1 = tslib_1.__importDefault(require("ow"));
exports.fieldNamePredicate = ow_1.default.string.minLength(1).maxLength(256);
exports.fieldValuePredicate = ow_1.default.string.minLength(1).maxLength(1024);
exports.fieldInlinePredicate = ow_1.default.optional.boolean;
exports.embedFieldPredicate = ow_1.default.object.exactShape({
name: exports.fieldNamePredicate,
value: exports.fieldValuePredicate,
inline: exports.fieldInlinePredicate,
});
exports.embedFieldsArrayPredicate = ow_1.default.array.ofType(exports.embedFieldPredicate);
function validateFieldLength(fields, amountAdding) {
ow_1.default(fields.length + amountAdding, 'field amount', ow_1.default.number.lessThanOrEqual(25));
}
exports.validateFieldLength = validateFieldLength;
exports.authorNamePredicate = ow_1.default.any(exports.fieldNamePredicate, ow_1.default.null);
exports.urlPredicate = ow_1.default.any(ow_1.default.string.url, ow_1.default.nullOrUndefined);
exports.colorPredicate = ow_1.default.any(ow_1.default.number.greaterThanOrEqual(0).lessThanOrEqual(0xffffff), ow_1.default.null);
exports.descriptionPredicate = ow_1.default.any(ow_1.default.string.minLength(1).maxLength(4096), ow_1.default.null);
exports.footerTextPredicate = ow_1.default.any(ow_1.default.string.minLength(1).maxLength(2048), ow_1.default.null);
exports.timestampPredicate = ow_1.default.any(ow_1.default.number, ow_1.default.date, ow_1.default.null);
exports.titlePredicate = ow_1.default.any(exports.fieldNamePredicate, ow_1.default.null);
//# sourceMappingURL=Assertions.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"Assertions.js","sourceRoot":"/","sources":["messages/embed/Assertions.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AAEP,QAAA,kBAAkB,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAE3D,QAAA,mBAAmB,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAE7D,QAAA,oBAAoB,GAAG,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;AAE3C,QAAA,mBAAmB,GAAG,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC;IACvD,IAAI,EAAE,0BAAkB;IACxB,KAAK,EAAE,2BAAmB;IAC1B,MAAM,EAAE,4BAAoB;CAC5B,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,YAAE,CAAC,KAAK,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC;AAE9E,SAAgB,mBAAmB,CAAC,MAAuB,EAAE,YAAoB;IAChF,YAAE,CAAC,MAAM,CAAC,MAAM,GAAG,YAAY,EAAE,cAAc,EAAE,YAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;AACjF,CAAC;AAFD,kDAEC;AAEY,QAAA,mBAAmB,GAAG,YAAE,CAAC,GAAG,CAAC,0BAAkB,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC;AAE1D,QAAA,YAAY,GAAG,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,CAAC,GAAG,EAAE,YAAE,CAAC,eAAe,CAAC,CAAC;AAEzD,QAAA,cAAc,GAAG,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC;AAE5F,QAAA,oBAAoB,GAAG,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC;AAE/E,QAAA,mBAAmB,GAAG,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC;AAE9E,QAAA,kBAAkB,GAAG,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,EAAE,YAAE,CAAC,IAAI,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC;AAEzD,QAAA,cAAc,GAAG,YAAE,CAAC,GAAG,CAAC,0BAAkB,EAAE,YAAE,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import type { APIEmbedField } from 'discord-api-types/v9';\nimport ow from 'ow';\n\nexport const fieldNamePredicate = ow.string.minLength(1).maxLength(256);\n\nexport const fieldValuePredicate = ow.string.minLength(1).maxLength(1024);\n\nexport const fieldInlinePredicate = ow.optional.boolean;\n\nexport const embedFieldPredicate = ow.object.exactShape({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = ow.array.ofType(embedFieldPredicate);\n\nexport function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void {\n\tow(fields.length + amountAdding, 'field amount', ow.number.lessThanOrEqual(25));\n}\n\nexport const authorNamePredicate = ow.any(fieldNamePredicate, ow.null);\n\nexport const urlPredicate = ow.any(ow.string.url, ow.nullOrUndefined);\n\nexport const colorPredicate = ow.any(ow.number.greaterThanOrEqual(0).lessThanOrEqual(0xffffff), ow.null);\n\nexport const descriptionPredicate = ow.any(ow.string.minLength(1).maxLength(4096), ow.null);\n\nexport const footerTextPredicate = ow.any(ow.string.minLength(1).maxLength(2048), ow.null);\n\nexport const timestampPredicate = ow.any(ow.number, ow.date, ow.null);\n\nexport const titlePredicate = ow.any(fieldNamePredicate, ow.null);\n"]}

View file

@ -0,0 +1,140 @@
import type { APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo } from 'discord-api-types/v9';
export interface AuthorOptions {
name: string;
url?: string;
iconURL?: string;
}
export interface FooterOptions {
text: string;
iconURL?: string;
}
/**
* Represents an embed in a message (image/video preview, rich embed, etc.)
*/
export 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;
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;
/**
* Removes, replaces, or inserts fields in the embed (max 25).
* @param index The index to start at.
* @param deleteCount The number of fields to remove.
* @param fields The replacing field objects.
*/
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
/**
* Sets the author of this embed.
* @param options The options for the author.
*/
setAuthor(options: AuthorOptions | null): this;
/**
* Sets the color of this embed.
* @param color The color of the embed.
*/
setColor(color: number | null): this;
/**
* Sets the description of this embed.
* @param description The description.
*/
setDescription(description: string | null): this;
/**
* Sets the footer of this embed.
* @param options The options for the footer.
*/
setFooter(options: FooterOptions | null): this;
/**
* Sets the image of this embed.
* @param url The URL of the image.
*/
setImage(url: string | null): this;
/**
* Sets the thumbnail of this embed.
* @param url The URL of the thumbnail.
*/
setThumbnail(url: string | null): this;
/**
* Sets the timestamp of this embed.
* @param timestamp The timestamp or date.
*/
setTimestamp(timestamp?: number | Date | null): this;
/**
* Sets the title of this embed.
* @param title The title.
*/
setTitle(title: string | null): this;
/**
* Sets the URL of this embed.
* @param url The URL.
*/
setURL(url: string | null): this;
/**
* 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[];
}
//# sourceMappingURL=Embed.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"Embed.d.ts","sourceRoot":"/","sources":["messages/embed/Embed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,MAAM,sBAAsB,CAAC;AAiB9B,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,KAAM,YAAW,QAAQ;IACrC;;OAEG;IACI,MAAM,EAAE,aAAa,EAAE,CAAC;IAE/B;;OAEG;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACI,WAAW,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACI,GAAG,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACI,SAAS,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACI,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACI,KAAK,CAAC,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACI,KAAK,CAAC,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACI,MAAM,CAAC,EAAE,cAAc,CAAC;IAE/B;;OAEG;IACI,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACI,MAAM,CAAC,EAAE,cAAc,CAAC;gBAEZ,IAAI,GAAE,QAAa;IAgBtC;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAQ1B;IAED;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAI3C;;;OAGG;IACI,SAAS,CAAC,GAAG,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI;IAWlD;;;;;OAKG;IACI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI;IAWzF;;;OAGG;IACI,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAgBrD;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ3C;;;OAGG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQvD;;;OAGG;IACI,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAerD;;;OAGG;IACI,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQzC;;;OAGG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ7C;;;OAGG;IACI,YAAY,CAAC,SAAS,GAAE,MAAM,GAAG,IAAI,GAAG,IAAiB,GAAG,IAAI;IAQvE;;;OAGG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ3C;;;OAGG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQvC;;OAEG;IACI,MAAM,IAAI,QAAQ;IAIzB;;;OAGG;WACW,eAAe,CAAC,GAAG,MAAM,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE;CAS1E"}

View file

@ -0,0 +1,300 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Embed = void 0;
const tslib_1 = require("tslib");
const ow_1 = tslib_1.__importDefault(require("ow"));
const Assertions_1 = require("./Assertions");
/**
* Represents an embed in a message (image/video preview, rich embed, etc.)
*/
class Embed {
constructor(data = {}) {
/**
* An array of fields of this embed.
*/
Object.defineProperty(this, "fields", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed title.
*/
Object.defineProperty(this, "title", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed description.
*/
Object.defineProperty(this, "description", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed url.
*/
Object.defineProperty(this, "url", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed color.
*/
Object.defineProperty(this, "color", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The timestamp of the embed in the ISO format.
*/
Object.defineProperty(this, "timestamp", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed thumbnail data.
*/
Object.defineProperty(this, "thumbnail", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed image data.
*/
Object.defineProperty(this, "image", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* Received video data.
*/
Object.defineProperty(this, "video", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed author data.
*/
Object.defineProperty(this, "author", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* Received data about the embed provider.
*/
Object.defineProperty(this, "provider", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
/**
* The embed footer data.
*/
Object.defineProperty(this, "footer", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.title = data.title;
this.description = data.description;
this.url = data.url;
this.color = data.color;
this.thumbnail = data.thumbnail;
this.image = data.image;
this.video = data.video;
this.author = data.author;
this.provider = data.provider;
this.footer = data.footer;
this.fields = data.fields ?? [];
if (data.timestamp)
this.timestamp = new Date(data.timestamp).toISOString();
}
/**
* The accumulated length for the embed title, description, fields, footer text, and author name.
*/
get length() {
return ((this.title?.length ?? 0) +
(this.description?.length ?? 0) +
this.fields.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) +
(this.footer?.text.length ?? 0) +
(this.author?.name?.length ?? 0));
}
/**
* Adds a field to the embed (max 25).
* @param field The field to add.
*/
addField(field) {
return this.addFields(field);
}
/**
* Adds fields to the embed (max 25).
* @param fields The fields to add.
*/
addFields(...fields) {
// Data assertions
ow_1.default(fields, 'fields', Assertions_1.embedFieldsArrayPredicate);
// Ensure adding these fields won't exceed the 25 field limit
Assertions_1.validateFieldLength(this.fields, fields.length);
this.fields.push(...Embed.normalizeFields(...fields));
return this;
}
/**
* Removes, replaces, or inserts fields in the embed (max 25).
* @param index The index to start at.
* @param deleteCount The number of fields to remove.
* @param fields The replacing field objects.
*/
spliceFields(index, deleteCount, ...fields) {
// Data assertions
ow_1.default(fields, 'fields', Assertions_1.embedFieldsArrayPredicate);
// Ensure adding these fields won't exceed the 25 field limit
Assertions_1.validateFieldLength(this.fields, fields.length - deleteCount);
this.fields.splice(index, deleteCount, ...Embed.normalizeFields(...fields));
return this;
}
/**
* Sets the author of this embed.
* @param options The options for the author.
*/
setAuthor(options) {
if (options === null) {
this.author = undefined;
return this;
}
const { name, iconURL, url } = options;
// Data assertions
ow_1.default(name, 'name', Assertions_1.authorNamePredicate);
ow_1.default(iconURL, 'iconURL', Assertions_1.urlPredicate);
ow_1.default(url, 'url', Assertions_1.urlPredicate);
this.author = { name, url, icon_url: iconURL };
return this;
}
/**
* Sets the color of this embed.
* @param color The color of the embed.
*/
setColor(color) {
// Data assertions
ow_1.default(color, 'color', Assertions_1.colorPredicate);
this.color = color ?? undefined;
return this;
}
/**
* Sets the description of this embed.
* @param description The description.
*/
setDescription(description) {
// Data assertions
ow_1.default(description, 'description', Assertions_1.descriptionPredicate);
this.description = description ?? undefined;
return this;
}
/**
* Sets the footer of this embed.
* @param options The options for the footer.
*/
setFooter(options) {
if (options === null) {
this.footer = undefined;
return this;
}
const { text, iconURL } = options;
// Data assertions
ow_1.default(text, 'text', Assertions_1.footerTextPredicate);
ow_1.default(iconURL, 'iconURL', Assertions_1.urlPredicate);
this.footer = { text, icon_url: iconURL };
return this;
}
/**
* Sets the image of this embed.
* @param url The URL of the image.
*/
setImage(url) {
// Data assertions
ow_1.default(url, 'url', Assertions_1.urlPredicate);
this.image = url ? { url } : undefined;
return this;
}
/**
* Sets the thumbnail of this embed.
* @param url The URL of the thumbnail.
*/
setThumbnail(url) {
// Data assertions
ow_1.default(url, 'url', Assertions_1.urlPredicate);
this.thumbnail = url ? { url } : undefined;
return this;
}
/**
* Sets the timestamp of this embed.
* @param timestamp The timestamp or date.
*/
setTimestamp(timestamp = Date.now()) {
// Data assertions
ow_1.default(timestamp, 'timestamp', Assertions_1.timestampPredicate);
this.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;
return this;
}
/**
* Sets the title of this embed.
* @param title The title.
*/
setTitle(title) {
// Data assertions
ow_1.default(title, 'title', Assertions_1.titlePredicate);
this.title = title ?? undefined;
return this;
}
/**
* Sets the URL of this embed.
* @param url The URL.
*/
setURL(url) {
// Data assertions
ow_1.default(url, 'url', Assertions_1.urlPredicate);
this.url = url ?? undefined;
return this;
}
/**
* Transforms the embed to a plain object.
*/
toJSON() {
return { ...this };
}
/**
* Normalizes field input and resolves strings.
* @param fields Fields to normalize.
*/
static normalizeFields(...fields) {
return fields.flat(Infinity).map((field) => {
ow_1.default(field.name, 'field name', Assertions_1.fieldNamePredicate);
ow_1.default(field.value, 'field value', Assertions_1.fieldValuePredicate);
ow_1.default(field.inline, 'field inline', Assertions_1.fieldInlinePredicate);
return { name: field.name, value: field.value, inline: field.inline ?? undefined };
});
}
}
exports.Embed = Embed;
//# sourceMappingURL=Embed.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,198 @@
/// <reference types="node" />
import type { Snowflake } from 'discord-api-types/globals';
import type { URL } from 'url';
/**
* Wraps the content inside a codeblock with no language.
* @param content The content to wrap.
*/
export declare function codeBlock<C extends string>(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.
*/
export declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
/**
* Wraps the content inside \`backticks\`, which formats it as inline code.
* @param content The content to wrap.
*/
export declare function inlineCode<C extends string>(content: C): `\`${C}\``;
/**
* Formats the content into italic text.
* @param content The content to wrap.
*/
export declare function italic<C extends string>(content: C): `_${C}_`;
/**
* Formats the content into bold text.
* @param content The content to wrap.
*/
export declare function bold<C extends string>(content: C): `**${C}**`;
/**
* Formats the content into underscored text.
* @param content The content to wrap.
*/
export declare function underscore<C extends string>(content: C): `__${C}__`;
/**
* Formats the content into strike-through text.
* @param content The content to wrap.
*/
export declare function strikethrough<C extends string>(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.
*/
export declare function quote<C extends string>(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.
*/
export declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
/**
* Wraps the URL into `<>`, which stops it from embedding.
* @param url The URL to wrap.
*/
export declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
/**
* Wraps the URL into `<>`, which stops it from embedding.
* @param url The URL to wrap.
*/
export 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.
*/
export declare function hyperlink<C extends string>(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.
*/
export declare function hyperlink<C extends string, U extends string>(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.
*/
export declare function hyperlink<C extends string, T extends string>(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.
*/
export declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
/**
* Wraps the content inside spoiler (hidden text).
* @param content The content to wrap.
*/
export declare function spoiler<C extends string>(content: C): `||${C}||`;
/**
* Formats a user ID into a user mention.
* @param userId The user ID to format.
*/
export declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
/**
* Formats a user ID into a member-nickname mention.
* @param memberId The user ID to format.
*/
export declare function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>`;
/**
* Formats a channel ID into a channel mention.
* @param channelId The channel ID to format.
*/
export declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
/**
* Formats a role ID into a role mention.
* @param roleId The role ID to format.
*/
export declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
/**
* Formats an emoji ID into a fully qualified emoji identifier
* @param emojiId The emoji ID to format.
*/
export declare function formatEmoji<C extends Snowflake>(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`
*/
export declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
/**
* Formats a date into a short date-time string.
* @param date The date to format, defaults to the current time.
*/
export declare function time(date?: Date): `<t:${bigint}>`;
/**
* Formats a date given a format style.
* @param date The date to format.
* @param style The style to use.
*/
export declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
/**
* Formats the given timestamp into a short date-time string.
* @param seconds The time to format, represents an UNIX timestamp in seconds.
*/
export declare function time<C extends number>(seconds: C): `<t:${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.
*/
export declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
/**
* The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.
*/
export declare const TimestampStyles: {
/**
* Short time format, consisting of hours and minutes, e.g. 16:20.
*/
readonly ShortTime: "t";
/**
* Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30.
*/
readonly LongTime: "T";
/**
* Short date format, consisting of day, month, and year, e.g. 20/04/2021.
*/
readonly ShortDate: "d";
/**
* Long date format, consisting of day, month, and year, e.g. 20 April 2021.
*/
readonly LongDate: "D";
/**
* Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20.
*/
readonly ShortDateTime: "f";
/**
* Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20.
*/
readonly LongDateTime: "F";
/**
* Relative time format, consisting of a relative duration format, e.g. 2 months ago.
*/
readonly RelativeTime: "R";
};
/**
* The possible values, see {@link TimestampStyles} for more information.
*/
export declare type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];
/**
* An enum with all the available faces from Discord's native slash commands
*/
export declare enum Faces {
/**
* ¯\\_()\\_/¯
*/
Shrug = "\u00AF\\_(\u30C4)\\_/\u00AF",
/**
* (°°
*/
Tableflip = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B",
/**
* ( -)
*/
Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"
}
//# sourceMappingURL=formatters.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"formatters.d.ts","sourceRoot":"/","sources":["messages/formatters.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;AAKjH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAEnE;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAE7D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAE7D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAEnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAEtE;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAE5D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,CAEnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;AAElE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC;AAMvD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC,KAAK,MAAM,GAAG,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAC3D,OAAO,EAAE,CAAC,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,CAAC,GACN,IAAI,CAAC,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC;AAE9B;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAC7E,OAAO,EAAE,CAAC,EACV,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,CAAC,GACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;AAMzB;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAEhE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAErE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAElF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAE3E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAEtE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;AAW5F;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,MAAM,GAAG,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC;AAElG;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAS/G;;GAEG;AACH,eAAO,MAAM,eAAe;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AAEX;;GAEG;AACH,oBAAY,qBAAqB,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEzF;;GAEG;AACH,oBAAY,KAAK;IAChB;;OAEG;IACH,KAAK,gCAAiB;IAEtB;;OAEG;IACH,SAAS,mEAAiB;IAE1B;;OAEG;IACH,MAAM,oDAAiB;CACvB"}

View file

@ -0,0 +1,181 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Faces = exports.TimestampStyles = exports.time = exports.formatEmoji = exports.roleMention = exports.channelMention = exports.memberNicknameMention = exports.userMention = exports.spoiler = exports.hyperlink = exports.hideLinkEmbed = exports.blockQuote = exports.quote = exports.strikethrough = exports.underscore = exports.bold = exports.italic = exports.inlineCode = exports.codeBlock = void 0;
function codeBlock(language, content) {
return typeof content === 'undefined' ? `\`\`\`\n${language}\`\`\`` : `\`\`\`${language}\n${content}\`\`\``;
}
exports.codeBlock = codeBlock;
/**
* Wraps the content inside \`backticks\`, which formats it as inline code.
* @param content The content to wrap.
*/
function inlineCode(content) {
return `\`${content}\``;
}
exports.inlineCode = inlineCode;
/**
* Formats the content into italic text.
* @param content The content to wrap.
*/
function italic(content) {
return `_${content}_`;
}
exports.italic = italic;
/**
* Formats the content into bold text.
* @param content The content to wrap.
*/
function bold(content) {
return `**${content}**`;
}
exports.bold = bold;
/**
* Formats the content into underscored text.
* @param content The content to wrap.
*/
function underscore(content) {
return `__${content}__`;
}
exports.underscore = underscore;
/**
* Formats the content into strike-through text.
* @param content The content to wrap.
*/
function strikethrough(content) {
return `~~${content}~~`;
}
exports.strikethrough = strikethrough;
/**
* 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.
*/
function quote(content) {
return `> ${content}`;
}
exports.quote = quote;
/**
* 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.
*/
function blockQuote(content) {
return `>>> ${content}`;
}
exports.blockQuote = blockQuote;
function hideLinkEmbed(url) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return `<${url}>`;
}
exports.hideLinkEmbed = hideLinkEmbed;
function hyperlink(content, url, title) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return title ? `[${content}](${url} "${title}")` : `[${content}](${url})`;
}
exports.hyperlink = hyperlink;
/**
* Wraps the content inside spoiler (hidden text).
* @param content The content to wrap.
*/
function spoiler(content) {
return `||${content}||`;
}
exports.spoiler = spoiler;
/**
* Formats a user ID into a user mention.
* @param userId The user ID to format.
*/
function userMention(userId) {
return `<@${userId}>`;
}
exports.userMention = userMention;
/**
* Formats a user ID into a member-nickname mention.
* @param memberId The user ID to format.
*/
function memberNicknameMention(memberId) {
return `<@!${memberId}>`;
}
exports.memberNicknameMention = memberNicknameMention;
/**
* Formats a channel ID into a channel mention.
* @param channelId The channel ID to format.
*/
function channelMention(channelId) {
return `<#${channelId}>`;
}
exports.channelMention = channelMention;
/**
* Formats a role ID into a role mention.
* @param roleId The role ID to format.
*/
function roleMention(roleId) {
return `<@&${roleId}>`;
}
exports.roleMention = roleMention;
/**
* 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`
*/
function formatEmoji(emojiId, animated = false) {
return `<${animated ? 'a' : ''}:_:${emojiId}>`;
}
exports.formatEmoji = formatEmoji;
function time(timeOrSeconds, style) {
if (typeof timeOrSeconds !== 'number') {
timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);
}
return typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;
}
exports.time = time;
/**
* The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.
*/
exports.TimestampStyles = {
/**
* Short time format, consisting of hours and minutes, e.g. 16:20.
*/
ShortTime: 't',
/**
* Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30.
*/
LongTime: 'T',
/**
* Short date format, consisting of day, month, and year, e.g. 20/04/2021.
*/
ShortDate: 'd',
/**
* Long date format, consisting of day, month, and year, e.g. 20 April 2021.
*/
LongDate: 'D',
/**
* Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20.
*/
ShortDateTime: 'f',
/**
* Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20.
*/
LongDateTime: 'F',
/**
* Relative time format, consisting of a relative duration format, e.g. 2 months ago.
*/
RelativeTime: 'R',
};
/**
* An enum with all the available faces from Discord's native slash commands
*/
var Faces;
(function (Faces) {
/**
* ¯\\_()\\_/¯
*/
Faces["Shrug"] = "\u00AF\\_(\u30C4)\\_/\u00AF";
/**
* (°°
*/
Faces["Tableflip"] = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B";
/**
* ( -)
*/
Faces["Unflip"] = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)";
})(Faces = exports.Faces || (exports.Faces = {}));
//# sourceMappingURL=formatters.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 vladfrangu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,97 @@
# Discord API Types
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
## Installation
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh
npm install discord-api-types
yarn add discord-api-types
pnpm add discord-api-types
```
### Usage
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v9');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v9';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v9');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v9';
```
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
1. Directly from GitHub
```ts
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v9.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v9.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v9?dts';
```
## Project Structure
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.

View file

@ -0,0 +1,9 @@
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
*/
export interface GatewayURLQuery {
v: string;
encoding: 'json' | 'etf';
compress?: 'zlib-stream';
}
//# sourceMappingURL=common.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;CACzB"}

View file

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=common.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":""}

View file

@ -0,0 +1,2 @@
export * from './v9';
//# sourceMappingURL=index.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,MAAM,CAAC"}

View file

@ -0,0 +1,16 @@
"use strict";
// This file exports all the types available in the recommended gateway version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./v9"), exports);
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,2FAA2F;;;;;;;;;;;;AAE3F,uCAAqB"}

View file

@ -0,0 +1,8 @@
import mod from "./index.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOpcodes = mod.GatewayOpcodes;
export const GatewayVersion = mod.GatewayVersion;

View file

@ -0,0 +1,608 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
import type { APIChannel, APIEmoji, APIGuild, APIGuildMember, APIMessage, APIRole, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus } from '../payloads/v6/index';
export * from './common';
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare const GatewayVersion = "6";
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayOPCodes {
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
PresenceUpdate = 3,
VoiceStateUpdate = 4,
Resume = 6,
Reconnect = 7,
RequestGuildMembers = 8,
InvalidSession = 9,
Hello = 10,
HeartbeatAck = 11
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayCloseCodes {
UnknownError = 4000,
UnknownOpCode = 4001,
DecodeError = 4002,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated = 4005,
InvalidSeq = 4007,
RateLimited = 4008,
SessionTimedOut = 4009,
InvalidShard = 4010,
ShardingRequired = 4011,
InvalidAPIVersion = 4012,
InvalidIntents = 4013,
DisallowedIntents = 4014
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum VoiceOPCodes {
Identify = 0,
SelectProtocol = 1,
Ready = 2,
Heartbeat = 3,
SessionDescription = 4,
Speaking = 5,
HeartbeatAck = 6,
Resume = 7,
Hello = 8,
Resumed = 9,
ClientDisconnect = 13
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum VoiceCloseCodes {
UnknownOpCode = 4001,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated = 4005,
SessionNoLongerValid = 4006,
SessionTimeout = 4009,
ServerNotFound = 4011,
UnknownProtocol = 4012,
Disconnected = 4014,
VoiceServerCrashed = 4015,
UnknownEncryptionMode = 4016
}
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayIntentBits {
GUILDS = 1,
GUILD_MEMBERS = 2,
GUILD_BANS = 4,
GUILD_EMOJIS = 8,
GUILD_INTEGRATIONS = 16,
GUILD_WEBHOOKS = 32,
GUILD_INVITES = 64,
GUILD_VOICE_STATES = 128,
GUILD_PRESENCES = 256,
GUILD_MESSAGES = 512,
GUILD_MESSAGE_REACTIONS = 1024,
GUILD_MESSAGE_TYPING = 2048,
DIRECT_MESSAGES = 4096,
DIRECT_MESSAGE_REACTIONS = 8192,
DIRECT_MESSAGE_TYPING = 16384
}
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare enum GatewayDispatchEvents {
Ready = "READY",
Resumed = "RESUMED",
ChannelCreate = "CHANNEL_CREATE",
ChannelUpdate = "CHANNEL_UPDATE",
ChannelDelete = "CHANNEL_DELETE",
ChannelPinsUpdate = "CHANNEL_PINS_UPDATE",
GuildCreate = "GUILD_CREATE",
GuildUpdate = "GUILD_UPDATE",
GuildDelete = "GUILD_DELETE",
GuildBanAdd = "GUILD_BAN_ADD",
GuildBanRemove = "GUILD_BAN_REMOVE",
GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE",
GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE",
GuildMemberAdd = "GUILD_MEMBER_ADD",
GuildMemberRemove = "GUILD_MEMBER_REMOVE",
GuildMemberUpdate = "GUILD_MEMBER_UPDATE",
GuildMembersChunk = "GUILD_MEMBERS_CHUNK",
GuildRoleCreate = "GUILD_ROLE_CREATE",
GuildRoleUpdate = "GUILD_ROLE_UPDATE",
GuildRoleDelete = "GUILD_ROLE_DELETE",
InviteCreate = "INVITE_CREATE",
InviteDelete = "INVITE_DELETE",
MessageCreate = "MESSAGE_CREATE",
MessageUpdate = "MESSAGE_UPDATE",
MessageDelete = "MESSAGE_DELETE",
MessageDeleteBulk = "MESSAGE_DELETE_BULK",
MessageReactionAdd = "MESSAGE_REACTION_ADD",
MessageReactionRemove = "MESSAGE_REACTION_REMOVE",
MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL",
MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI",
PresenceUpdate = "PRESENCE_UPDATE",
TypingStart = "TYPING_START",
UserUpdate = "USER_UPDATE",
VoiceStateUpdate = "VOICE_STATE_UPDATE",
VoiceServerUpdate = "VOICE_SERVER_UPDATE",
WebhooksUpdate = "WEBHOOKS_UPDATE"
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayResume | GatewayRequestGuildMembers;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayReceivePayload = GatewayHello | GatewayHeartbeatRequest | GatewayHeartbeatAck | GatewayInvalidSession | GatewayReconnect | GatewayDispatchPayload;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayDispatchPayload = GatewayReadyDispatch | GatewayResumedDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildBanModifyDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageUpdateDispatch | GatewayMessageDeleteDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayPresenceUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayWebhooksUpdateDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#hello
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHello extends NonDispatchPayload {
op: GatewayOPCodes.Hello;
d: {
heartbeat_interval: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
op: GatewayOPCodes.Heartbeat;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatAck extends NonDispatchPayload {
op: GatewayOPCodes.HeartbeatAck;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#invalid-session
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayInvalidSession extends NonDispatchPayload {
op: GatewayOPCodes.InvalidSession;
d: boolean;
}
/**
* https://discord.com/developers/docs/topics/gateway#reconnect
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayReconnect extends NonDispatchPayload {
op: GatewayOPCodes.Reconnect;
d: never;
}
/**
* https://discord.com/developers/docs/topics/gateway#ready
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, {
v: number;
user: APIUser;
session_id: string;
private_channels: [];
guilds: APIUnavailableGuild[];
shard?: [number, number];
}>;
/**
* https://discord.com/developers/docs/topics/gateway#resumed
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
* https://discord.com/developers/docs/topics/gateway#channel-delete
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayChannelModifyDispatch = DataPayload<GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate, APIChannel>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayChannelPinsUpdateDispatch = DataPayload<GatewayDispatchEvents.ChannelPinsUpdate, {
guild_id?: string;
channel_id: string;
last_pin_timestamp?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate, APIGuild>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-delete
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildBanModifyDispatch = DataPayload<GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove, {
guild_id: string;
user: APIUser;
}>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildEmojisUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildEmojisUpdate, {
guild_id: string;
emojis: APIEmoji[];
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildIntegrationsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildIntegrationsUpdate, {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-add
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildMemberAddDispatch = DataPayload<GatewayDispatchEvents.GuildMemberAdd, APIGuildMember & {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildMemberRemoveDispatch = DataPayload<GatewayDispatchEvents.GuildMemberRemove, {
guild_id: string;
user: APIUser;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildMemberUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildMemberUpdate, Omit<APIGuildMember, 'deaf' | 'mute'> & {
guild_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildMembersChunkDispatch = DataPayload<GatewayDispatchEvents.GuildMembersChunk, {
guild_id: string;
members: APIGuildMember[];
chunk_index?: number;
chunk_count?: number;
not_found?: unknown[];
presences?: RawGatewayPresenceUpdate[];
nonce?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* https://discord.com/developers/docs/topics/gateway#guild-role-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildRoleModifyDispatch = DataPayload<GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate, {
guild_id: string;
role: APIRole;
}>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayGuildRoleDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildRoleDelete, {
guild_id: string;
role_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayInviteCreateDispatch = DataPayload<GatewayDispatchEvents.InviteCreate, {
channel_id: string;
code: string;
created_at: number;
guild_id?: string;
inviter?: APIUser;
max_age: number;
max_uses: number;
target_user?: APIUser;
target_user_type?: InviteTargetUserType;
temporary: boolean;
uses: 0;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#invite-delete
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayInviteDeleteDispatch = DataPayload<GatewayDispatchEvents.InviteDelete, {
channel_id: string;
guild_id?: string;
code: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-create
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
/**
* https://discord.com/developers/docs/topics/gateway#message-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageUpdateDispatch = DataPayload<GatewayDispatchEvents.MessageUpdate, {
id: string;
channel_id: string;
} & Partial<APIMessage>>;
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageDeleteDispatch = DataPayload<GatewayDispatchEvents.MessageDelete, {
id: string;
channel_id: string;
guild_id?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageDeleteBulkDispatch = DataPayload<GatewayDispatchEvents.MessageDeleteBulk, {
ids: string[];
channel_id: string;
guild_id?: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageReactionRemoveAllDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveAll, MessageReactionRemoveData>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<GatewayDispatchEvents.MessageReactionRemoveEmoji, MessageReactionRemoveData & {
emoji: APIEmoji;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#presence-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
/**
* https://discord.com/developers/docs/topics/gateway#typing-start
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, {
channel_id: string;
guild_id?: string;
user_id: string;
timestamp: number;
member?: APIGuildMember;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#user-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-state-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-server-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayVoiceServerUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceServerUpdate, {
token: string;
guild_id: string;
endpoint: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#webhooks-update
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export declare type GatewayWebhooksUpdateDispatch = DataPayload<GatewayDispatchEvents.WebhooksUpdate, {
guild_id: string;
channel_id: string;
}>;
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeat {
op: GatewayOPCodes.Heartbeat;
d: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentifyProperties {
$os: string;
$browser: string;
$device: string;
}
/**
* https://discord.com/developers/docs/topics/gateway#identify
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentify {
op: GatewayOPCodes.Identify;
d: {
token: string;
properties: GatewayIdentifyProperties;
compress?: boolean;
large_threshold?: number;
shard?: [shard_id: number, shard_count: number];
presence?: RawGatewayPresenceUpdate;
guild_subscriptions?: boolean;
intents?: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#resume
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayResume {
op: GatewayOPCodes.Resume;
d: {
token: string;
session_id: string;
seq: number;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayRequestGuildMembers {
op: GatewayOPCodes.RequestGuildMembers;
d: {
guild_id: string | string[];
query?: string;
limit: number;
presences?: boolean;
user_ids?: string | string[];
nonce?: string;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayVoiceStateUpdate {
op: GatewayOPCodes.VoiceStateUpdate;
d: {
guild_id: string;
channel_id: string | null;
self_mute: boolean;
self_deaf: boolean;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#update-status
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayUpdatePresence {
op: GatewayOPCodes.PresenceUpdate;
d: GatewayPresenceUpdateData;
}
/**
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayPresenceUpdateData {
since: number | null;
game: GatewayActivity | null;
status: PresenceUpdateStatus;
afk: boolean;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface BasePayload {
op: GatewayOPCodes;
s: number;
d?: unknown;
t?: string;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
declare type NonDispatchPayload = Omit<BasePayload, 't'>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
op: GatewayOPCodes.Dispatch;
t: Event;
d: D;
}
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
declare type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<E, Omit<{
user_id: string;
channel_id: string;
message_id: string;
guild_id?: string;
member?: APIGuildMember;
emoji: APIEmoji;
}, O>>;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
interface MessageReactionRemoveData {
channel_id: string;
message_id: string;
guild_id?: string;
}
//# sourceMappingURL=v6.d.ts.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,163 @@
"use strict";
/**
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.VoiceCloseCodes = exports.VoiceOPCodes = exports.GatewayCloseCodes = exports.GatewayOPCodes = exports.GatewayVersion = void 0;
__exportStar(require("./common"), exports);
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
exports.GatewayVersion = '6';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayOPCodes;
(function (GatewayOPCodes) {
GatewayOPCodes[GatewayOPCodes["Dispatch"] = 0] = "Dispatch";
GatewayOPCodes[GatewayOPCodes["Heartbeat"] = 1] = "Heartbeat";
GatewayOPCodes[GatewayOPCodes["Identify"] = 2] = "Identify";
GatewayOPCodes[GatewayOPCodes["PresenceUpdate"] = 3] = "PresenceUpdate";
GatewayOPCodes[GatewayOPCodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate";
GatewayOPCodes[GatewayOPCodes["Resume"] = 6] = "Resume";
GatewayOPCodes[GatewayOPCodes["Reconnect"] = 7] = "Reconnect";
GatewayOPCodes[GatewayOPCodes["RequestGuildMembers"] = 8] = "RequestGuildMembers";
GatewayOPCodes[GatewayOPCodes["InvalidSession"] = 9] = "InvalidSession";
GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello";
GatewayOPCodes[GatewayOPCodes["HeartbeatAck"] = 11] = "HeartbeatAck";
})(GatewayOPCodes = exports.GatewayOPCodes || (exports.GatewayOPCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayCloseCodes;
(function (GatewayCloseCodes) {
GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError";
GatewayCloseCodes[GatewayCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited";
GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut";
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion";
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents";
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes = exports.GatewayCloseCodes || (exports.GatewayCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var VoiceOPCodes;
(function (VoiceOPCodes) {
VoiceOPCodes[VoiceOPCodes["Identify"] = 0] = "Identify";
VoiceOPCodes[VoiceOPCodes["SelectProtocol"] = 1] = "SelectProtocol";
VoiceOPCodes[VoiceOPCodes["Ready"] = 2] = "Ready";
VoiceOPCodes[VoiceOPCodes["Heartbeat"] = 3] = "Heartbeat";
VoiceOPCodes[VoiceOPCodes["SessionDescription"] = 4] = "SessionDescription";
VoiceOPCodes[VoiceOPCodes["Speaking"] = 5] = "Speaking";
VoiceOPCodes[VoiceOPCodes["HeartbeatAck"] = 6] = "HeartbeatAck";
VoiceOPCodes[VoiceOPCodes["Resume"] = 7] = "Resume";
VoiceOPCodes[VoiceOPCodes["Hello"] = 8] = "Hello";
VoiceOPCodes[VoiceOPCodes["Resumed"] = 9] = "Resumed";
VoiceOPCodes[VoiceOPCodes["ClientDisconnect"] = 13] = "ClientDisconnect";
})(VoiceOPCodes = exports.VoiceOPCodes || (exports.VoiceOPCodes = {}));
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var VoiceCloseCodes;
(function (VoiceCloseCodes) {
VoiceCloseCodes[VoiceCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode";
VoiceCloseCodes[VoiceCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
VoiceCloseCodes[VoiceCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
VoiceCloseCodes[VoiceCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated";
VoiceCloseCodes[VoiceCloseCodes["SessionNoLongerValid"] = 4006] = "SessionNoLongerValid";
VoiceCloseCodes[VoiceCloseCodes["SessionTimeout"] = 4009] = "SessionTimeout";
VoiceCloseCodes[VoiceCloseCodes["ServerNotFound"] = 4011] = "ServerNotFound";
VoiceCloseCodes[VoiceCloseCodes["UnknownProtocol"] = 4012] = "UnknownProtocol";
VoiceCloseCodes[VoiceCloseCodes["Disconnected"] = 4014] = "Disconnected";
VoiceCloseCodes[VoiceCloseCodes["VoiceServerCrashed"] = 4015] = "VoiceServerCrashed";
VoiceCloseCodes[VoiceCloseCodes["UnknownEncryptionMode"] = 4016] = "UnknownEncryptionMode";
})(VoiceCloseCodes = exports.VoiceCloseCodes || (exports.VoiceCloseCodes = {}));
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayIntentBits;
(function (GatewayIntentBits) {
GatewayIntentBits[GatewayIntentBits["GUILDS"] = 1] = "GUILDS";
GatewayIntentBits[GatewayIntentBits["GUILD_MEMBERS"] = 2] = "GUILD_MEMBERS";
GatewayIntentBits[GatewayIntentBits["GUILD_BANS"] = 4] = "GUILD_BANS";
GatewayIntentBits[GatewayIntentBits["GUILD_EMOJIS"] = 8] = "GUILD_EMOJIS";
GatewayIntentBits[GatewayIntentBits["GUILD_INTEGRATIONS"] = 16] = "GUILD_INTEGRATIONS";
GatewayIntentBits[GatewayIntentBits["GUILD_WEBHOOKS"] = 32] = "GUILD_WEBHOOKS";
GatewayIntentBits[GatewayIntentBits["GUILD_INVITES"] = 64] = "GUILD_INVITES";
GatewayIntentBits[GatewayIntentBits["GUILD_VOICE_STATES"] = 128] = "GUILD_VOICE_STATES";
GatewayIntentBits[GatewayIntentBits["GUILD_PRESENCES"] = 256] = "GUILD_PRESENCES";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGES"] = 512] = "GUILD_MESSAGES";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_REACTIONS"] = 1024] = "GUILD_MESSAGE_REACTIONS";
GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_TYPING"] = 2048] = "GUILD_MESSAGE_TYPING";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGES"] = 4096] = "DIRECT_MESSAGES";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_REACTIONS"] = 8192] = "DIRECT_MESSAGE_REACTIONS";
GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_TYPING"] = 16384] = "DIRECT_MESSAGE_TYPING";
})(GatewayIntentBits = exports.GatewayIntentBits || (exports.GatewayIntentBits = {}));
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
var GatewayDispatchEvents;
(function (GatewayDispatchEvents) {
GatewayDispatchEvents["Ready"] = "READY";
GatewayDispatchEvents["Resumed"] = "RESUMED";
GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE";
GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE";
GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE";
GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE";
GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE";
GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD";
GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE";
GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE";
GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE";
GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD";
GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE";
GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE";
GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK";
GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE";
GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE";
GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE";
GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE";
GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE";
GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE";
GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE";
GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE";
GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK";
GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD";
GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE";
GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL";
GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI";
GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE";
GatewayDispatchEvents["TypingStart"] = "TYPING_START";
GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE";
GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
})(GatewayDispatchEvents = exports.GatewayDispatchEvents || (exports.GatewayDispatchEvents = {}));
// #endregion Shared
//# sourceMappingURL=v6.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;AAkBH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;GAGG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACzB,2DAAQ,CAAA;IACR,6DAAS,CAAA;IACT,2DAAQ,CAAA;IACR,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAEhB,uDAAU,CAAA;IACV,6DAAS,CAAA;IACT,iFAAmB,CAAA;IACnB,uEAAc,CAAA;IACd,sDAAK,CAAA;IACL,oEAAY,CAAA;AACb,CAAC,EAbW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAazB;AAED;;;GAGG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,4EAAmB,CAAA;IACnB,8EAAa,CAAA;IACb,0EAAW,CAAA;IACX,oFAAgB,CAAA;IAChB,4FAAoB,CAAA;IACpB,4FAAoB,CAAA;IAEpB,wEAAiB,CAAA;IACjB,0EAAW,CAAA;IACX,kFAAe,CAAA;IACf,4EAAY,CAAA;IACZ,oFAAgB,CAAA;IAChB,sFAAiB,CAAA;IACjB,gFAAc,CAAA;IACd,sFAAiB,CAAA;AAClB,CAAC,EAhBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAgB5B;AAED;;;GAGG;AACH,IAAY,YAaX;AAbD,WAAY,YAAY;IACvB,uDAAQ,CAAA;IACR,mEAAc,CAAA;IACd,iDAAK,CAAA;IACL,yDAAS,CAAA;IACT,2EAAkB,CAAA;IAClB,uDAAQ,CAAA;IACR,+DAAY,CAAA;IACZ,mDAAM,CAAA;IACN,iDAAK,CAAA;IACL,qDAAO,CAAA;IAEP,wEAAqB,CAAA;AACtB,CAAC,EAbW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAavB;AAED;;;GAGG;AACH,IAAY,eAgBX;AAhBD,WAAY,eAAe;IAC1B,0EAAoB,CAAA;IAEpB,gFAAuB,CAAA;IACvB,wFAAoB,CAAA;IACpB,wFAAoB,CAAA;IACpB,wFAAoB,CAAA;IAEpB,4EAAqB,CAAA;IAErB,4EAAqB,CAAA;IACrB,8EAAe,CAAA;IAEf,wEAAmB,CAAA;IACnB,oFAAkB,CAAA;IAClB,0FAAqB,CAAA;AACtB,CAAC,EAhBW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAgB1B;AAED;;;GAGG;AACH,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,2EAAsB,CAAA;IACtB,qEAAmB,CAAA;IACnB,yEAAqB,CAAA;IACrB,sFAA2B,CAAA;IAC3B,8EAAuB,CAAA;IACvB,4EAAsB,CAAA;IACtB,uFAA2B,CAAA;IAC3B,iFAAwB,CAAA;IACxB,+EAAuB,CAAA;IACvB,kGAAiC,CAAA;IACjC,4FAA8B,CAAA;IAC9B,kFAAyB,CAAA;IACzB,oGAAkC,CAAA;IAClC,+FAA+B,CAAA;AAChC,CAAC,EAhBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAgB5B;AAED;;;GAGG;AACH,IAAY,qBAqCX;AArCD,WAAY,qBAAqB;IAChC,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,2DAAkC,CAAA;IAClC,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,gEAAuC,CAAA;IACvC,kEAAyC,CAAA;IACzC,2DAAkC,CAAA;AACnC,CAAC,EArCW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAqChC;AAwoBD,oBAAoB"}

View file

@ -0,0 +1,10 @@
import mod from "./v6.js";
export default mod;
export const GatewayCloseCodes = mod.GatewayCloseCodes;
export const GatewayDispatchEvents = mod.GatewayDispatchEvents;
export const GatewayIntentBits = mod.GatewayIntentBits;
export const GatewayOPCodes = mod.GatewayOPCodes;
export const GatewayVersion = mod.GatewayVersion;
export const VoiceCloseCodes = mod.VoiceCloseCodes;
export const VoiceOPCodes = mod.VoiceOPCodes;

Some files were not shown because too many files have changed in this diff Show more