@koishijs/plugin-adapter-discord 2.0.0-beta.2 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bot.d.ts CHANGED
@@ -7,9 +7,9 @@ import * as Discord from './types';
7
7
  export interface BotConfig extends Bot.BaseConfig, Sender.Config {
8
8
  token: string;
9
9
  }
10
- export declare const BotConfig: Schema<unknown>;
10
+ export declare const BotConfig: Schema<unknown, any>;
11
11
  export declare class DiscordBot extends Bot<BotConfig> {
12
- static schema: Schema<AdapterConfig>;
12
+ static schema: Schema<AdapterConfig, AdapterConfig>;
13
13
  _d: number;
14
14
  _ping: NodeJS.Timeout;
15
15
  _sessionId: string;
package/lib/index.js CHANGED
@@ -1208,17 +1208,17 @@ Internal.define({
1208
1208
  // plugins/adapter/discord/src/bot.ts
1209
1209
  var BotConfig = import_koishi3.Schema.intersect([
1210
1210
  import_koishi3.Schema.object({
1211
- token: import_koishi3.Schema.string("机器人的用户令牌。").required(),
1211
+ token: import_koishi3.Schema.string().description("机器人的用户令牌。").required(),
1212
1212
  handleExternalAsset: import_koishi3.Schema.select({
1213
1213
  download: "先下载后发送",
1214
1214
  direct: "直接发送链接",
1215
1215
  auto: "发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送"
1216
- }, "发送外链资源时采用的方式。").default("auto"),
1216
+ }).description("发送外链资源时采用的方式。").default("auto"),
1217
1217
  handleMixedContent: import_koishi3.Schema.select({
1218
1218
  separate: "将每个不同形式的内容分开发送",
1219
1219
  attach: "图片前如果有文本内容,则将文本作为图片的附带信息进行发送",
1220
1220
  auto: "如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送"
1221
- }, "发送图文等混合内容时采用的方式。").default("auto")
1221
+ }).description("发送图文等混合内容时采用的方式。").default("auto")
1222
1222
  }),
1223
1223
  import_koishi3.App.Config.Request
1224
1224
  ]);
package/lib/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/bot.ts", "../src/utils.ts", "../src/sender.ts", "../src/types/index.ts", "../src/types/internal.ts", "../src/types/application.ts", "../src/types/audit-log.ts", "../src/types/channel.ts", "../src/types/command.ts", "../src/types/component.ts", "../src/types/device.ts", "../src/types/emoji.ts", "../src/types/gateway.ts", "../src/types/guild-member.ts", "../src/types/guild-template.ts", "../src/types/guild.ts", "../src/types/integration.ts", "../src/types/interaction.ts", "../src/types/invite.ts", "../src/types/message.ts", "../src/types/presence.ts", "../src/types/role.ts", "../src/types/stage-instance.ts", "../src/types/sticker.ts", "../src/types/team.ts", "../src/types/user.ts", "../src/types/voice.ts", "../src/types/webhook.ts", "../src/ws.ts"],
4
- "sourcesContent": ["import { Adapter } from 'koishi'\nimport { DiscordBot } from './bot'\nimport * as Discord from './types'\nimport WebSocketClient from './ws'\n\nexport { Discord }\n\nexport * from './bot'\nexport * from './sender'\nexport * from './utils'\nexport * from './ws'\n\ndeclare module 'koishi' {\n interface Modules {\n 'adapter-discord': typeof import('.')\n }\n\n interface Session {\n discord?: Discord.GatewayPayload & Discord.Internal\n }\n}\n\nexport default Adapter.define('discord', DiscordBot, WebSocketClient)\n", "/* eslint-disable camelcase */\n\nimport { Adapter, App, Bot, Schema, segment, Quester } from 'koishi'\nimport { adaptChannel, adaptGroup as adaptGuild, adaptMessage, adaptUser, AdapterConfig } from './utils'\nimport { Sender } from './sender'\nimport * as Discord from './types'\n\nexport interface BotConfig extends Bot.BaseConfig, Sender.Config {\n token: string\n}\n\nexport const BotConfig = Schema.intersect([\n Schema.object({\n token: Schema.string('机器人的用户令牌。').required(),\n handleExternalAsset: Schema.select({\n download: '先下载后发送',\n direct: '直接发送链接',\n auto: '发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送',\n }, '发送外链资源时采用的方式。').default('auto'),\n handleMixedContent: Schema.select({\n separate: '将每个不同形式的内容分开发送',\n attach: '图片前如果有文本内容,则将文本作为图片的附带信息进行发送',\n auto: '如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送',\n }, '发送图文等混合内容时采用的方式。').default('auto'),\n }),\n App.Config.Request,\n])\n\nexport class DiscordBot extends Bot<BotConfig> {\n static schema = AdapterConfig\n\n _d: number\n _ping: NodeJS.Timeout\n _sessionId: string\n\n public http: Quester\n public internal: Discord.Internal\n\n constructor(adapter: Adapter, config: BotConfig) {\n super(adapter, config)\n this._d = 0\n this._sessionId = ''\n this.http = adapter.http.extend({\n headers: { Authorization: `Bot ${config.token}`, },\n })\n this.internal = new Discord.Internal(this.http)\n }\n\n async getSelf() {\n const data = await this.internal.getCurrentUser()\n return adaptUser(data)\n }\n\n private parseQuote(chain: segment.Chain) {\n if (chain[0].type !== 'quote') return\n return chain.shift().data.id\n }\n\n async sendMessage(channelId: string, content: string, guildId?: string) {\n const session = this.createSession({ channelId, content, guildId, subtype: guildId ? 'group' : 'private' })\n if (await this.app.serial(session, 'before-send', session)) return\n\n const chain = segment.parse(session.content)\n const quote = this.parseQuote(chain)\n const message_reference = quote ? {\n message_id: quote,\n } : undefined\n\n const send = Sender.from(this, `/channels/${channelId}/messages`)\n session.messageId = await send(session.content, { message_reference })\n\n this.app.emit(session, 'send', session)\n return session.messageId\n }\n\n async sendPrivateMessage(channelId: string, content: string) {\n return this.sendMessage(channelId, content)\n }\n\n async deleteMessage(channelId: string, messageId: string) {\n await this.internal.deleteMessage(channelId, messageId)\n }\n\n async editMessage(channelId: string, messageId: string, content: string) {\n const chain = segment.parse(content)\n const image = chain.find(v => v.type === 'image')\n if (image) {\n throw new Error(\"You can't include embed object(s) while editing message.\")\n }\n await this.internal.editMessage(channelId, messageId, {\n content,\n })\n }\n\n async getMessage(channelId: string, messageId: string): Promise<Bot.Message> {\n const [msg, channel] = await Promise.all([\n this.internal.getChannelMessage(channelId, messageId),\n this.internal.getChannel(channelId),\n ])\n const result: Bot.Message = {\n messageId: msg.id,\n channelId: msg.channel_id,\n guildId: channel.guild_id,\n userId: msg.author.id,\n content: msg.content,\n timestamp: new Date(msg.timestamp).valueOf(),\n author: adaptUser(msg.author),\n }\n result.author.nickname = msg.member?.nick\n if (msg.message_reference) {\n const quoteMsg = await this.internal.getChannelMessage(msg.message_reference.channel_id, msg.message_reference.message_id)\n result.quote = adaptMessage(this, quoteMsg)\n }\n return result\n }\n\n async getUser(userId: string) {\n const data = await this.internal.getUser(userId)\n return adaptUser(data)\n }\n\n async getGuildMemberList(guildId: string) {\n const data = await this.internal.listGuildMembers(guildId)\n return data.map(v => adaptUser(v.user))\n }\n\n async getChannel(channelId: string) {\n const data = await this.internal.getChannel(channelId)\n return adaptChannel(data)\n }\n\n async getGuildMember(guildId: string, userId: string) {\n const member = await this.internal.getGuildMember(guildId, userId)\n return {\n ...adaptUser(member.user),\n nickname: member.nick,\n }\n }\n\n async getGuild(guildId: string) {\n const data = await this.internal.getGuild(guildId)\n return adaptGuild(data)\n }\n\n async getGuildList() {\n const data = await this.internal.getCurrentUserGuilds()\n return data.map(v => adaptGuild(v))\n }\n\n async getChannelList(guildId: string) {\n const data = await this.internal.getGuildChannels(guildId)\n return data.map(v => adaptChannel(v))\n }\n}\n", "/* eslint-disable camelcase */\nimport { Adapter, App, Bot, Schema, segment, Session } from 'koishi'\nimport { DiscordBot } from './bot'\nimport * as DC from './types'\n\nexport interface AdapterConfig extends Adapter.WebSocketClient.Config, App.Config.Request {}\n\nexport const AdapterConfig: Schema<AdapterConfig> = Schema.intersect([\n App.Config.Request,\n Adapter.WebSocketClient.Config,\n])\n\nexport const adaptUser = (user: DC.User): Bot.User => ({\n userId: user.id,\n avatar: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png`,\n username: user.username,\n discriminator: user.discriminator,\n isBot: user.bot || false,\n})\n\nexport function adaptGroup(data: DC.Guild): Bot.Guild {\n return {\n guildId: data.id,\n guildName: data.name,\n }\n}\n\nexport function adaptChannel(data: DC.Channel): Bot.Channel {\n return {\n channelId: data.id,\n channelName: data.name,\n }\n}\n\nexport const adaptAuthor = (author: DC.User): Bot.Author => ({\n ...adaptUser(author),\n nickname: author.username,\n})\n\nexport function adaptMessage(bot: DiscordBot, meta: DC.Message, session: Partial<Session> = {}) {\n if (meta.author) {\n session.author = adaptAuthor(meta.author)\n session.userId = meta.author.id\n }\n if (meta.member?.nick) {\n session.author.nickname = meta.member?.nick\n }\n\n // https://discord.com/developers/docs/reference#message-formatting\n session.content = ''\n if (meta.content) {\n session.content = meta.content\n .replace(/<@[!&](.+?)>/, (_, id) => {\n if (meta.mention_roles.includes(id)) {\n return segment('at', { role: id })\n } else {\n const user = meta.mentions?.find(u => u.id === id)\n return segment.at(id, { name: user?.username })\n }\n })\n .replace(/<:(.*):(.+?)>/, (_, name, id) => segment('face', { id: id, name }))\n .replace(/<a:(.*):(.+?)>/, (_, name, id) => segment('face', { id: id, name, animated: true }))\n .replace(/@everyone/, () => segment('at', { type: 'all' }))\n .replace(/@here/, () => segment('at', { type: 'here' }))\n .replace(/<#(.+?)>/, (_, id) => {\n const channel = meta.mention_channels?.find(c => c.id === id)\n return segment.sharp(id, { name: channel?.name })\n })\n }\n\n // embed 的 update event 太阴间了 只有 id embeds channel_id guild_id 四个成员\n if (meta.attachments?.length) {\n session.content += meta.attachments.map(v => {\n if (v.height && v.width && v.content_type?.startsWith('image/')) {\n return segment('image', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else if (v.height && v.width && v.content_type?.startsWith('video/')) {\n return segment('video', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else if (v.content_type?.startsWith('audio/')) {\n return segment('record', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else {\n return segment('file', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n }\n }).join('')\n }\n for (const embed of meta.embeds) {\n // not using embed types\n // https://discord.com/developers/docs/resources/channel#embed-object-embed-types\n if (embed.image) {\n session.content += segment('image', { url: embed.image.url, proxy_url: embed.image.proxy_url })\n }\n if (embed.thumbnail) {\n session.content += segment('image', { url: embed.thumbnail.url, proxy_url: embed.thumbnail.proxy_url })\n }\n if (embed.video) {\n session.content += segment('video', { url: embed.video.url, proxy_url: embed.video.proxy_url })\n }\n }\n return session as Bot.Message\n}\n\nfunction adaptMessageSession(bot: DiscordBot, meta: DC.Message, session: Partial<Session> = {}) {\n adaptMessage(bot, meta, session)\n session.messageId = meta.id\n session.timestamp = new Date(meta.timestamp).valueOf() || Date.now()\n // 遇到过 cross post 的消息在这里不会传消息 id\n if (meta.message_reference) {\n const { message_id, channel_id } = meta.message_reference\n session.content = segment('quote', { id: message_id, channelId: channel_id }) + session.content\n }\n return session\n}\n\nfunction prepareMessageSession(session: Partial<Session>, data: Partial<DC.Message>) {\n session.guildId = data.guild_id\n session.subtype = data.guild_id ? 'group' : 'private'\n session.channelId = data.channel_id\n}\n\nfunction prepareReactionSession(session: Partial<Session>, data: any) {\n session.userId = data.user_id\n session.messageId = data.message_id\n session.guildId = data.guild_id\n session.channelId = data.channel_id\n session.subtype = data.guild_id ? 'group' : 'private'\n if (!data.emoji) return\n const { id, name } = data.emoji\n session.content = id ? `${name}:${id}` : name\n}\n\nexport async function adaptSession(bot: DiscordBot, input: DC.GatewayPayload) {\n const session: Partial<Session> = {\n selfId: bot.selfId,\n }\n if (input.t === 'MESSAGE_CREATE') {\n session.type = 'message'\n prepareMessageSession(session, input.d)\n adaptMessageSession(bot, input.d, session)\n // dc 情况特殊 可能有 embeds 但是没有消息主体\n // if (!session.content) return\n if (session.userId === bot.selfId) return\n } else if (input.t === 'MESSAGE_UPDATE') {\n session.type = 'message-updated'\n prepareMessageSession(session, input.d)\n const msg = await bot.internal.getChannelMessage(input.d.channel_id, input.d.id)\n // Unlike creates, message updates may contain only a subset of the full message object payload\n // https://discord.com/developers/docs/topics/gateway#message-update\n adaptMessageSession(bot, msg, session)\n // if (!session.content) return\n if (session.userId === bot.selfId) return\n } else if (input.t === 'MESSAGE_DELETE') {\n session.type = 'message-deleted'\n session.messageId = input.d.id\n prepareMessageSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_ADD') {\n session.type = 'reaction-added'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE') {\n session.type = 'reaction-deleted'\n session.subtype = 'one'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_ALL') {\n session.type = 'reaction-deleted'\n session.subtype = 'all'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_EMOJI') {\n session.type = 'reaction-deleted'\n session.subtype = 'emoji'\n prepareReactionSession(session, input.d)\n } else {\n return\n }\n return new Session(bot, session)\n}\n", "import { readFileSync } from 'fs'\nimport { basename } from 'path'\nimport { fromBuffer } from 'file-type'\nimport FormData from 'form-data'\nimport AggregateError from 'es-aggregate-error'\nimport { DiscordBot } from './bot'\nimport { segment, Dict } from 'koishi'\n\nexport type HandleExternalAsset = 'auto' | 'download' | 'direct'\nexport type HandleMixedContent = 'auto' | 'separate' | 'attach'\n\nexport namespace Sender {\n export interface Config {\n /**\n * 发送外链资源时采用的方式\n * - download:先下载后发送\n * - direct:直接发送链接\n * - auto:发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送(默认)\n */\n handleExternalAsset?: HandleExternalAsset\n /**\n * 发送图文等混合内容时采用的方式\n * - separate:将每个不同形式的内容分开发送\n * - attach:图片前如果有文本内容,则将文本作为图片的附带信息进行发送\n * - auto:如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送(默认)\n */\n handleMixedContent?: HandleMixedContent\n }\n}\n\nexport class Sender {\n private errors: Error[] = []\n\n private constructor(private bot: DiscordBot, private url: string) {}\n\n static from(bot: DiscordBot, url: string) {\n return new Sender(bot, url).sendMessage\n }\n\n async post(data?: any, headers?: any) {\n try {\n const result = await this.bot.http('POST', this.url, data, headers)\n return result.id as string\n } catch (e) {\n this.errors.push(e)\n }\n }\n\n async sendEmbed(fileBuffer: ArrayBuffer, payload_json: Dict = {}, filename: string) {\n const fd = new FormData()\n const type = await fromBuffer(fileBuffer)\n filename ||= 'file.' + type.ext\n fd.append('file', fileBuffer, filename)\n fd.append('payload_json', JSON.stringify(payload_json))\n return this.post(fd, fd.getHeaders())\n }\n\n async sendContent(content: string, addition: Dict) {\n return this.post({ ...addition, content })\n }\n\n async sendAsset(type: string, data: Dict<string>, addition: Dict) {\n const { handleMixedContent, handleExternalAsset } = this.bot.config\n\n if (handleMixedContent === 'separate' && addition.content) {\n await this.post(addition)\n addition.content = ''\n }\n\n if (data.url.startsWith('file://')) {\n const filename = basename(data.url.slice(7))\n return this.sendEmbed(readFileSync(data.url.slice(7)), addition, data.file || filename)\n } else if (data.url.startsWith('base64://')) {\n const a = Buffer.from(data.url.slice(9), 'base64')\n return await this.sendEmbed(a, addition, data.file)\n }\n\n const sendDirect = async () => {\n if (addition.content) {\n await this.post(addition)\n }\n return this.post({ ...addition, content: data.url })\n }\n\n const sendDownload = async () => {\n const filename = basename(data.url)\n const buffer = await this.bot.app.http.get.arraybuffer(data.url, {}, {\n accept: type + '/*',\n })\n return this.sendEmbed(buffer, addition, data.file || filename)\n }\n\n const mode = data.mode as HandleExternalAsset || handleExternalAsset\n if (mode === 'download' || handleMixedContent === 'attach' && addition.content || type === 'file') {\n return sendDownload()\n } else if (mode === 'direct') {\n return sendDirect()\n }\n\n // auto mode\n await this.bot.app.http.head(data.url, {}, {\n accept: type + '/*',\n }).then((headers) => {\n if (headers['content-type'].startsWith(type)) {\n return sendDirect()\n } else {\n return sendDownload()\n }\n }, sendDownload)\n }\n\n sendMessage = async (content: string, addition: Dict = {}) => {\n const chain = segment.parse(content)\n let messageId = '0'\n let textBuffer = ''\n delete addition.content\n\n const sendBuffer = async () => {\n const content = textBuffer.trim()\n if (!content) return\n messageId = await this.post({ ...addition, content })\n textBuffer = ''\n }\n\n for (const code of chain) {\n const { type, data } = code\n if (type === 'text') {\n textBuffer += data.content.trim()\n } else if (type === 'at' && data.id) {\n textBuffer += `<@${data.id}>`\n } else if (type === 'at' && data.type === 'all') {\n textBuffer += `@everyone`\n } else if (type === 'at' && data.type === 'here') {\n textBuffer += `@here`\n } else if (type === 'sharp' && data.id) {\n textBuffer += `<#${data.id}>`\n } else if (type === 'face' && data.name && data.id) {\n textBuffer += `<:${data.name}:${data.id}>`\n } else if ((type === 'image' || type === 'video') && data.url) {\n messageId = await this.sendAsset(type, data, {\n ...addition,\n content: textBuffer.trim(),\n })\n textBuffer = ''\n } else if (type === 'share') {\n await sendBuffer()\n messageId = await this.post({\n ...addition,\n embeds: [{ ...data }],\n })\n } else if (type === 'record'){\n await this.sendAsset('file', data, {\n ...addition,\n content: textBuffer.trim(),\n })\n textBuffer = ''\n }\n }\n\n await sendBuffer()\n if (!this.errors.length) return messageId\n\n throw new AggregateError(this.errors)\n }\n}\n", "export * from './internal'\n\nexport * from './application'\nexport * from './audit-log'\nexport * from './channel'\nexport * from './command'\nexport * from './component'\nexport * from './device'\nexport * from './emoji'\nexport * from './gateway'\nexport * from './guild-member'\nexport * from './guild-template'\nexport * from './guild'\nexport * from './integration'\nexport * from './interaction'\nexport * from './invite'\nexport * from './message'\nexport * from './presence'\nexport * from './role'\nexport * from './stage-instance'\nexport * from './sticker'\nexport * from './team'\nexport * from './user'\nexport * from './voice'\nexport * from './webhook'\n\nexport type integer = number\nexport type snowflake = string\nexport type timestamp = string\n", "import { Quester } from 'koishi'\n\ntype Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'\n\nexport class Internal {\n static define(routes: Record<string, Partial<Record<Method, string>>>) {\n for (const path in routes) {\n for (const method in routes[path]) {\n const name = routes[path][method]\n Internal.prototype[name] = function (this: Internal, ...args: any[]) {\n const url = path.replace(/\\{([^}]+)\\}/g, () => args.shift())\n return this.http(method as any, url)\n }\n }\n }\n }\n\n constructor(private http: Quester) {}\n}\n", "import { Guild, integer, Internal, snowflake, Team, User } from '.'\n\n/** https://discord.com/developers/docs/resources/application#application-object-application-structure */\nexport interface Application {\n /** the id of the app */\n id: snowflake\n /** the name of the app */\n name: string\n /** the icon hash of the app */\n icon?: string\n /** the description of the app */\n description: string\n /** an array of rpc origin urls, if rpc is enabled */\n rpc_origins?: string[]\n /** when false only app owner can join the app's bot to guilds */\n bot_public: boolean\n /** when true the app's bot will only join upon completion of the full oauth2 code grant flow */\n bot_require_code_grant: boolean\n /** the url of the app's terms of service */\n terms_of_service_url?: string\n /** the url of the app's privacy policy */\n privacy_policy_url?: string\n /** partial user object containing info on the owner of the application */\n owner?: Partial<User>\n /** if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */\n summary: string\n /** the hex encoded key for verification in interactions and the GameSDK's GetTicket */\n verify_key: string\n /** if the application belongs to a team, this will be a list of the members of that team */\n team?: Team\n /** if this application is a game sold on Discord, this field will be the guild to which it has been linked */\n guild_id?: snowflake\n /** if this application is a game sold on Discord, this field will be the id of the \"Game SKU\" that is created, if exists */\n primary_sku_id?: snowflake\n /** if this application is a game sold on Discord, this field will be the URL slug that links to the store page */\n slug?: string\n /** the application's default rich presence invite cover image hash */\n cover_image?: string\n /** the application's public flags */\n flags?: integer\n}\n\n/** https://discord.com/developers/docs/resources/application#application-object-application-flags */\nexport enum ApplicationFlag {\n GATEWAY_PRESENCE = 1 << 12,\n GATEWAY_PRESENCE_LIMITED = 1 << 13,\n GATEWAY_GUILD_MEMBERS = 1 << 14,\n GATEWAY_GUILD_MEMBERS_LIMITED = 1 << 15,\n VERIFICATION_PENDING_GUILD_LIMIT = 1 << 16,\n EMBEDDED = 1 << 17,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#ready-ready-event-fields */\nexport interface ReadyEvent {\n /** gateway version */\n v: integer\n /** information about the user including email */\n user: User\n /** the guilds the user is in */\n guilds: Partial<Guild>[]\n /** used for resuming connections */\n session_id: string\n /** the shard information associated with this session, if sent when identifying */\n shard?: [shard_id: integer, num_shards: integer]\n /** contains id and flags */\n application: Partial<Application>\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** contains the initial state information */\n READY: ReadyEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */\n getCurrentBotApplicationInformation(): Promise<Application>\n /** https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information */\n getCurrentAuthorizationInformation(): Promise<any>\n }\n}\n\nInternal.define({\n '/oauth2/applications/@me': {\n GET: 'getCurrentBotApplicationInformation',\n },\n '/oauth2/@me': {\n GET: 'getCurrentAuthorizationInformation',\n },\n})\n", "import { Channel, Integration, Internal, snowflake, User, Webhook } from '.'\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */\nexport interface AuditLog {\n /** list of audit log entries */\n audit_log_entries: AuditLogEntry[]\n /** list of partial integration objects */\n integrations: Partial<Integration>[]\n /** list of threads found in the audit log* */\n threads: Channel[]\n /** list of users found in the audit log */\n users: User[]\n /** list of webhooks found in the audit log */\n webhooks: Webhook[]\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */\nexport interface AuditLogEntry {\n /** id of the affected entity (webhook, user, role, etc.) */\n target_id?: string\n /** changes made to the target_id */\n changes?: AuditLogChange[]\n /** the user who made the changes */\n user_id?: snowflake\n /** id of the entry */\n id: snowflake\n /** type of action that occurred */\n action_type: AuditLogEvent\n /** additional info for certain action types */\n options?: OptionalAuditEntryInfo\n /** the reason for the change (0-512 characters) */\n reason?: string\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events */\nexport enum AuditLogEvent {\n GUILD_UPDATE = 1,\n CHANNEL_CREATE = 10,\n CHANNEL_UPDATE = 11,\n CHANNEL_DELETE = 12,\n CHANNEL_OVERWRITE_CREATE = 13,\n CHANNEL_OVERWRITE_UPDATE = 14,\n CHANNEL_OVERWRITE_DELETE = 15,\n MEMBER_KICK = 20,\n MEMBER_PRUNE = 21,\n MEMBER_BAN_ADD = 22,\n MEMBER_BAN_REMOVE = 23,\n MEMBER_UPDATE = 24,\n MEMBER_ROLE_UPDATE = 25,\n MEMBER_MOVE = 26,\n MEMBER_DISCONNECT = 27,\n BOT_ADD = 28,\n ROLE_CREATE = 30,\n ROLE_UPDATE = 31,\n ROLE_DELETE = 32,\n INVITE_CREATE = 40,\n INVITE_UPDATE = 41,\n INVITE_DELETE = 42,\n WEBHOOK_CREATE = 50,\n WEBHOOK_UPDATE = 51,\n WEBHOOK_DELETE = 52,\n EMOJI_CREATE = 60,\n EMOJI_UPDATE = 61,\n EMOJI_DELETE = 62,\n MESSAGE_DELETE = 72,\n MESSAGE_BULK_DELETE = 73,\n MESSAGE_PIN = 74,\n MESSAGE_UNPIN = 75,\n INTEGRATION_CREATE = 80,\n INTEGRATION_UPDATE = 81,\n INTEGRATION_DELETE = 82,\n STAGE_INSTANCE_CREATE = 83,\n STAGE_INSTANCE_UPDATE = 84,\n STAGE_INSTANCE_DELETE = 85,\n STICKER_CREATE = 90,\n STICKER_UPDATE = 91,\n STICKER_DELETE = 92,\n THREAD_CREATE = 110,\n THREAD_UPDATE = 111,\n THREAD_DELETE = 112,\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */\nexport interface OptionalAuditEntryInfo {\n /** channel in which the entities were targeted */\n channel_id: snowflake\n /** number of entities that were targeted */\n count: string\n /** number of days after which inactive members were kicked */\n delete_member_days: string\n /** id of the overwritten entity */\n id: snowflake\n /** number of members removed by the prune */\n members_removed: string\n /** id of the message that was targeted */\n message_id: snowflake\n /** name of the role if type is \"0\" (not present if type is \"1\") */\n role_name: string\n /** type of overwritten entity - \"0\" for \"role\" or \"1\" for \"member\" */\n type: string\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */\nexport interface AuditLogChange {\n /** new value of the key */\n new_value?: any\n /** old value of the key */\n old_value?: any\n /** name of audit log change key */\n key: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */\n getGuildAuditLog(guildId: snowflake): Promise<AuditLog>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/audit-logs': {\n GET: 'getGuildAuditLog',\n },\n})\n", "import { GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */\nexport interface Channel {\n /** the id of this channel */\n id: snowflake\n /** the type of channel */\n type: integer\n /** the id of the guild (may be missing for some channel objects received over gateway guild dispatches) */\n guild_id?: snowflake\n /** sorting position of the channel */\n position?: integer\n /** explicit permission overwrites for members and roles */\n permission_overwrites?: Overwrite[]\n /** the name of the channel (1-100 characters) */\n name?: string\n /** the channel topic (0-1024 characters) */\n topic?: string\n /** whether the channel is nsfw */\n nsfw?: boolean\n /** the id of the last message sent in this channel (may not point to an existing or valid message) */\n last_message_id?: snowflake\n /** the bitrate (in bits) of the voice channel */\n bitrate?: integer\n /** the user limit of the voice channel */\n user_limit?: integer\n /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected */\n rate_limit_per_user?: integer\n /** the recipients of the DM */\n recipients?: User[]\n /** icon hash */\n icon?: string\n /** id of the creator of the group DM or thread */\n owner_id?: snowflake\n /** application id of the group DM creator if it is bot-created */\n application_id?: snowflake\n /** for guild channels: id of the parent category for a channel (each parent category can contain up to 50 channels), for threads: id of the text channel this thread was created */\n parent_id?: snowflake\n /** when the last pinned message was pinned. This may be null in events such as GUILD_CREATE when a message is not pinned. */\n last_pin_timestamp?: timestamp\n /** voice region id for the voice channel, automatic when set to null */\n rtc_region?: string\n /** the camera video quality mode of the voice channel, 1 when not present */\n video_quality_mode?: integer\n /** an approximate count of messages in a thread, stops counting at 50 */\n message_count?: integer\n /** an approximate count of users in a thread, stops counting at 50 */\n member_count?: integer\n /** thread-specific fields not needed by other channels */\n thread_metadata?: ThreadMetadata\n /** thread member object for the current user, if they have joined the thread, only included on certain API endpoints */\n member?: ThreadMember\n /** default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */\n default_auto_archive_duration?: integer\n /** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on a slash command interaction */\n permissions?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */\nexport enum ChannelType {\n /** a text channel within a server */\n GUILD_TEXT = 0,\n /** a direct message between users */\n DM = 1,\n /** a voice channel within a server */\n GUILD_VOICE = 2,\n /** a direct message between multiple users */\n GROUP_DM = 3,\n /** an organizational category that contains up to 50 channels */\n GUILD_CATEGORY = 4,\n /** a channel that users can follow and crosspost into their own server */\n GUILD_NEWS = 5,\n /** a channel in which game developers can sell their game on Discord */\n GUILD_STORE = 6,\n /** a temporary sub-channel within a GUILD_NEWS channel */\n GUILD_NEWS_THREAD = 10,\n /** a temporary sub-channel within a GUILD_TEXT channel */\n GUILD_PUBLIC_THREAD = 11,\n /** a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission */\n GUILD_PRIVATE_THREAD = 12,\n /** a voice channel for hosting events with an audience */\n GUILD_STAGE_VOICE = 13,\n}\n\n/** https://discord.com/developers/docs/resources/channel#followed-channel-object-followed-channel-structure */\nexport interface FollowedChannel {\n /** source channel id */\n channel_id: snowflake\n /** created target webhook id */\n webhook_id: snowflake\n}\n\n/** https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure */\nexport interface Overwrite {\n /** role or user id */\n id: snowflake\n /** either 0 (role) or 1 (member) */\n type: integer\n /** permission bit set */\n allow: string\n /** permission bit set */\n deny: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure */\nexport interface ThreadMetadata {\n /** whether the thread is archived */\n archived: boolean\n /** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */\n auto_archive_duration: integer\n /** timestamp when the thread's archive status was last changed, used for calculating recent activity */\n archive_timestamp: timestamp\n /** whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it */\n locked: boolean\n /** whether non-moderators can add other non-moderators to a thread; only available on private threads */\n invitable?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#thread-member-object-thread-member-structure */\nexport interface ThreadMember {\n /** the id of the thread */\n id?: snowflake\n /** the id of the user */\n user_id?: snowflake\n /** the time the current user last joined the thread */\n join_timestamp: timestamp\n /** any user-thread settings, currently only used for notifications */\n flags: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types */\nexport enum AllowedMentionType {\n /** Controls role mentions */\n ROLE_MENTIONS = 'roles',\n /** Controls user mentions */\n USER_MENTIONS = 'users',\n /** Controls @everyone and @here mentions */\n EVERYONE_MENTIONS = 'everyone',\n}\n\n/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure */\nexport interface AllowedMentions {\n /** An array of allowed mention types to parse from the content. */\n parse: AllowedMentionType[]\n /** Array of role_ids to mention (Max size of 100) */\n roles: snowflake[]\n /** Array of user_ids to mention (Max size of 100) */\n users: snowflake[]\n /** For replies, whether to mention the author of the message being replied to (default false) */\n replied_user: boolean\n}\n\nexport interface ChannelCreateEvent extends Channel {}\n\nexport interface ChannelUpdateEvent extends Channel {}\n\nexport interface ChannelDeleteEvent extends Channel {}\n\n/** https://discord.com/developers/docs/topics/gateway#channel-pins-update-channel-pins-update-event-fields */\nexport interface ChannelPinsUpdateEvent {\n /** the id of the guild */\n guild_id?: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the time at which the most recent pinned message was pinned */\n last_pin_timestamp?: timestamp\n}\n\n/** https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields */\nexport interface ThreadListSyncEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the parent channel ids whose threads are being synced. If omitted, then threads were synced for the entire guild. This array may contain channel_ids that have no active threads as well, so you know to clear that data. */\n channel_ids?: snowflake[]\n /** all active threads in the given channels that the current user can access */\n threads: Channel[]\n /** all thread member objects from the synced threads for the current user, indicating which threads the current user has been added to */\n members: ThreadMember[]\n}\n\nexport interface ThreadMemberUpdateEvent extends ThreadMember {}\n\n/** https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields */\nexport interface ThreadMembersUpdateEvent {\n /** the id of the thread */\n id: snowflake\n /** the id of the guild */\n guild_id: snowflake\n /** the approximate number of members in the thread, capped at 50 */\n member_count: integer\n /** the users who were added to the thread */\n added_members?: ThreadMember[]\n /** the id of the users who were removed from the thread */\n removed_member_ids?: snowflake[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields */\nexport interface TypingStartEvent {\n /** id of the channel */\n channel_id: snowflake\n /** id of the guild */\n guild_id?: snowflake\n /** id of the user */\n user_id: snowflake\n /** unix time (in seconds) of when the user started typing */\n timestamp: integer\n /** the member who started typing if this happened in a guild */\n member?: GuildMember\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new guild channel created */\n CHANNEL_CREATE: ChannelCreateEvent\n /** channel was updated */\n CHANNEL_UPDATE: ChannelUpdateEvent\n /** channel was deleted */\n CHANNEL_DELETE: ChannelDeleteEvent\n /** message was pinned or unpinned */\n CHANNEL_PINS_UPDATE: ChannelPinsUpdateEvent\n /** sent when gaining access to a channel, contains all active threads in that channel */\n THREAD_LIST_SYNC: ThreadListSyncEvent\n /** thread member for the current user was updated */\n THREAD_MEMBER_UPDATE: ThreadMemberUpdateEvent\n /** some user(s) were added to or removed from a thread */\n THREAD_MEMBERS_UPDATE: ThreadMembersUpdateEvent\n /** user started typing in a channel */\n TYPING_START: TypingStartEvent\n }\n}\n\nexport interface ChannelPosition {\n /** channel id */\n channel_id: snowflake\n /** sorting position of the channel */\n position?: integer\n /** syncs the permission overwrites with the new parent, if moving to a new category */\n lock_permissions?: boolean\n /** the new parent ID for the channel that is moved */\n parent_id?: snowflake\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild-channels */\n getGuildChannels(guild_id: snowflake): Promise<Channel[]>\n /** https://discord.com/developers/docs/resources/guild#create-guild-channel */\n createGuildChannel(guild_id: snowflake, options: Partial<Channel>): Promise<Channel>\n /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */\n modifyGuildChannelPositions(guild_id: snowflake, positions: ChannelPosition[]): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/channels': {\n GET: 'getGuildChannels',\n POST: 'createGuildChannel',\n PATCH: 'modifyGuildChannelPositions',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#get-channel */\n getChannel(channel_id: string): Promise<Channel>\n /** https://discord.com/developers/docs/resources/channel#modify-channel */\n modifyChannel(channel_id: string, data: Partial<Channel>): Promise<Channel>\n /** https://discord.com/developers/docs/resources/channel#deleteclose-channel */\n deleteChannel(channel_id: string): Promise<Channel>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}': {\n GET: 'getChannel',\n PATCH: 'modifyChannel',\n DELETE: 'deleteChannel',\n },\n '/channels/{channel.id}/permissions/{overwrite.id}': {\n PUT: 'editChannelPermissions',\n DELETE: 'deleteChannelPermission',\n },\n '/channels/{channel.id}/invites': {\n GET: 'getChannelInvites',\n POST: 'createChannelInvite',\n },\n '/channels/{channel.id}/followers': {\n POST: 'followNewsChannel',\n },\n '/channels/{channel.id}/typing': {\n POST: 'triggerTypingIndicator',\n },\n '/channels/{channel.id}/pins': {\n GET: 'getPinnedMessages',\n },\n '/channels/{channel.id}/pins/{message.id}': {\n PUT: 'pinMessage',\n DELETE: 'unpinMessage',\n },\n '/channels/{channel.id}/recipients/{user.id}': {\n PUT: 'groupDMAddRecipient',\n DELETE: 'groupDMRemoveRecipient',\n },\n '/channels/{channel.id}/messages/{message.id}/threads': {\n POST: 'startThreadwithMessage',\n },\n '/channels/{channel.id}/threads': {\n POST: 'startThreadwithoutMessage',\n },\n '/channels/{channel.id}/thread-members/@me': {\n PUT: 'joinThread',\n DELETE: 'leaveThread',\n },\n '/channels/{channel.id}/thread-members/{user.id}': {\n PUT: 'addThreadMember',\n DELETE: 'removeThreadMember',\n GET: 'getThreadMember',\n },\n '/channels/{channel.id}/thread-members': {\n GET: 'listThreadMembers',\n },\n '/channels/{channel.id}/threads/active': {\n GET: 'listActiveThreads',\n },\n '/channels/{channel.id}/threads/archived/public': {\n GET: 'listPublicArchivedThreads',\n },\n '/channels/{channel.id}/threads/archived/private': {\n GET: 'listPrivateArchivedThreads',\n },\n '/channels/{channel.id}/users/@me/threads/archived/private': {\n GET: 'listJoinedPrivateArchivedThreads',\n },\n})\n", "import { ChannelType, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */\nexport interface ApplicationCommand {\n /** unique id of the command */\n id: snowflake\n /** the type of command, defaults 1 if not set */\n type?: ApplicationCommandType\n /** unique id of the parent application */\n application_id: snowflake\n /** guild id of the command, if not global */\n guild_id?: snowflake\n /** 1-32 character name */\n name: string\n /** 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands */\n description: string\n /** the parameters for the command, max 25 */\n options?: ApplicationCommandOption[]\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** autoincrementing version identifier updated during substantial record changes */\n version: snowflake\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */\nexport enum ApplicationCommandType {\n /** Slash commands; a text-based command that shows up when a user types / */\n CHAT_INPUT = 1,\n /** A UI-based command that shows up when you right click or tap on a user */\n USER = 2,\n /** A UI-based command that shows up when you right click or tap on a message */\n MESSAGE = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */\nexport interface ApplicationCommandOption {\n /** the type of option */\n type: ApplicationCommandOptionType\n /** 1-32 character name */\n name: string\n /** 1-100 character description */\n description: string\n /** if the parameter is required or optional--default false */\n required?: boolean\n /** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */\n choices?: ApplicationCommandOptionChoice[]\n /** if the option is a subcommand or subcommand group type, this nested options will be the parameters */\n options?: ApplicationCommandOption[]\n /** if the option is a channel type, the channels shown will be restricted to these types */\n channel_types?: ChannelType[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */\nexport enum ApplicationCommandOptionType {\n SUB_COMMAND = 1,\n SUB_COMMAND_GROUP = 2,\n STRING = 3,\n /** Any integer between -2^53 and 2^53 */\n INTEGER = 4,\n BOOLEAN = 5,\n USER = 6,\n /** Includes all channel types + categories */\n CHANNEL = 7,\n ROLE = 8,\n /** Includes users and roles */\n MENTIONABLE = 9,\n /** Any double between -2^53 and 2^53 */\n NUMBER = 10,\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */\nexport interface ApplicationCommandOptionChoice {\n /** 1-100 character choice name */\n name: string\n /** value of the choice, up to 100 characters if string */\n value: string | number\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure */\nexport interface ApplicationCommandInteractionDataOption {\n /** the name of the parameter */\n name: string\n /** value of application command option type */\n type: ApplicationCommandOptionType\n /** the value of the pair */\n value?: ApplicationCommandOptionType\n /** present if this option is a group or subcommand */\n options?: ApplicationCommandInteractionDataOption[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */\nexport interface GuildApplicationCommandPermissions {\n /** the id of the command */\n id: snowflake\n /** the id of the application the command belongs to */\n application_id: snowflake\n /** the id of the guild */\n guild_id: snowflake\n /** the permissions for the command in the guild */\n permissions: ApplicationCommandPermissions[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */\nexport interface ApplicationCommandPermissions {\n /** the id of the role or user */\n id: snowflake\n /** role or user */\n type: ApplicationCommandPermissionType\n /** true to allow, false, to disallow */\n permission: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */\nexport enum ApplicationCommandPermissionType {\n ROLE = 1,\n USER = 2,\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */\n getGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */\n createGlobalApplicationCommand(application_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */\n bulkOverwriteGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */\n getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */\n editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */\n deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */\n getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */\n createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */\n bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */\n getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<GuildApplicationCommandPermissions[]>\n /** https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions */\n batchEditApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, permissions: Partial<GuildApplicationCommandPermissions>[]): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */\n getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */\n editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */\n deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */\n getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<GuildApplicationCommandPermissions>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */\n editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, permissions: ApplicationCommandPermissions[]): Promise<GuildApplicationCommandPermissions>\n }\n}\n\nInternal.define({\n '/applications/{application.id}/commands': {\n GET: 'getGlobalApplicationCommands',\n POST: 'createGlobalApplicationCommand',\n PUT: 'bulkOverwriteGlobalApplicationCommands',\n },\n '/applications/{application.id}/commands/{command.id}': {\n GET: 'getGlobalApplicationCommand',\n PATCH: 'editGlobalApplicationCommand',\n DELETE: 'deleteGlobalApplicationCommand',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands': {\n GET: 'getGuildApplicationCommands',\n POST: 'createGuildApplicationCommand',\n PUT: 'bulkOverwriteGuildApplicationCommands',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}': {\n GET: 'getGuildApplicationCommand',\n PATCH: 'editGuildApplicationCommand',\n DELETE: 'deleteGuildApplicationCommand',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/permissions': {\n GET: 'getGuildApplicationCommandPermissions',\n PUT: 'batchEditApplicationCommandPermissions',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions': {\n GET: 'getApplicationCommandPermissions',\n PUT: 'editApplicationCommandPermissions',\n },\n})\n", "import { Emoji, integer } from '.'\n\n/** https://discord.com/developers/docs/interactions/message-components#component-object-component-structure */\nexport interface Component {\n /** component type */\n type: integer\n /** a developer-defined identifier for the component, max 100 characters */\n custom_id?: string\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** one of button styles */\n style?: integer\n /** text that appears on the button, max 80 characters */\n label?: string\n /** name, id, and animated */\n emoji?: Partial<Emoji>\n /** a url for link-style buttons */\n url?: string\n /** the choices in the select, max 25 */\n options?: SelectOption[]\n /** custom placeholder text if nothing is selected, max 100 characters */\n placeholder?: string\n /** the minimum number of items that must be chosen; default 1, min 0, max 25 */\n min_values?: integer\n /** the maximum number of items that can be chosen; default 1, max 25 */\n max_values?: integer\n /** a list of child components */\n components?: Component[]\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */\nexport enum ComponentType {\n /** A container for other components */\n ACTION_ROW = 1,\n /** A button object */\n BUTTON = 2,\n /** A select menu for picking from choices */\n SELECT_MENU = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */\nexport interface Button {\n /** 2 for a button */\n type: integer\n /** one of button styles */\n style: integer\n /** text that appears on the button, max 80 characters */\n label?: string\n /** name, id, and animated */\n emoji?: Partial<Emoji>\n /** a developer-defined identifier for the button, max 100 characters */\n custom_id?: string\n /** a url for link-style buttons */\n url?: string\n /** whether the button is disabled (default false) */\n disabled?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */\nexport interface SelectMenu {\n /** 3 for a select menu */\n type: integer\n /** a developer-defined identifier for the button, max 100 characters */\n custom_id: string\n /** the choices in the select, max 25 */\n options: SelectOption[]\n /** custom placeholder text if nothing is selected, max 100 characters */\n placeholder?: string\n /** the minimum number of items that must be chosen; default 1, min 0, max 25 */\n min_values?: integer\n /** the maximum number of items that can be chosen; default 1, max 25 */\n max_values?: integer\n /** disable the select, default false */\n disabled?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure */\nexport interface SelectOption {\n /** the user-facing name of the option, max 100 characters */\n label: string\n /** the dev-define value of the option, max 100 characters */\n value: string\n /** an additional description of the option, max 100 characters */\n description?: string\n /** id, name, and animated */\n emoji?: Partial<Emoji>\n /** will render this option as selected by default */\n default?: boolean\n}\n", "/** https://discord.com/developers/docs/topics/certified-devices#models-device-object */\nexport interface Device {\n /** the type of device */\n type: DeviceType\n /** the device's Windows UUID */\n id: string\n /** the hardware vendor */\n vendor: Vendor\n /** the model of the product */\n model: Model\n /** UUIDs of related devices */\n related: string[]\n /** if the device's native echo cancellation is enabled */\n echo_cancellation?: boolean\n /** if the device's native noise suppression is enabled */\n noise_suppression?: boolean\n /** if the device's native automatic gain control is enabled */\n automatic_gain_control?: boolean\n /** if the device is hardware muted */\n hardware_mute?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-vendor-object */\nexport interface Vendor {\n /** name of the vendor */\n name: string\n /** url for the vendor */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-model-object */\nexport interface Model {\n /** name of the model */\n name: string\n /** url for the model */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-device-type */\nexport enum DeviceType {\n AUDIO_INPUT = 'audioinput',\n AUDIO_OUTPUT = 'audiooutput',\n VIDEO_INPUT = 'videoinput',\n}\n", "import { GuildMember, integer, Internal, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */\nexport interface Emoji {\n /** emoji id */\n id?: snowflake\n /** emoji name */\n name?: string\n /** roles allowed to use this emoji */\n roles?: snowflake[]\n /** user that created this emoji */\n user?: User\n /** whether this emoji must be wrapped in colons */\n require_colons?: boolean\n /** whether this emoji is managed */\n managed?: boolean\n /** whether this emoji is animated */\n animated?: boolean\n /** whether this emoji can be used, may be false due to loss of Server Boosts */\n available?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure */\nexport interface Reaction {\n /** times this emoji has been used to react */\n count: integer\n /** whether the current user reacted using this emoji */\n me: boolean\n /** emoji information */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-emojis-update-guild-emojis-update-event-fields */\nexport interface GuildEmojisUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** array of emojis */\n emojis: Emoji[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields */\nexport interface MessageReactionAddEvent {\n /** the id of the user */\n user_id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the member who reacted if this happened in a guild */\n member?: GuildMember\n /** the emoji used to react - example */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields */\nexport interface MessageReactionRemoveEvent {\n /** the id of the user */\n user_id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the emoji used to react - example */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all-message-reaction-remove-all-event-fields */\nexport interface MessageReactionRemoveAllEvent {\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji-message-reaction-remove-emoji */\nexport interface MessageReactionRemoveEmojiEvent {\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the emoji that was removed */\n emoji: Partial<Emoji>\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild emojis were updated */\n GUILD_EMOJIS_UPDATE: GuildEmojisUpdateEvent\n /** user reacted to a message */\n MESSAGE_REACTION_ADD: MessageReactionAddEvent\n /** user removed a reaction from a message */\n MESSAGE_REACTION_REMOVE: MessageReactionRemoveEvent\n /** all reactions were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_ALL: MessageReactionRemoveAllEvent\n /** all reactions for a given emoji were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_EMOJI: MessageReactionRemoveEmojiEvent\n }\n}\n\nexport interface ModifyGuildEmojiOptions {\n /** name of the emoji */\n name?: string\n /** array of snowflakes\troles allowed to use this emoji */\n roles?: snowflake[]\n}\n\nexport interface CreateGuildEmojiOptions extends ModifyGuildEmojiOptions {\n /** the 128x128 emoji image */\n image: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */\n listGuildEmojis(guild_id: snowflake): Promise<Emoji[]>\n /** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */\n getGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */\n createGuildEmoji(guild_id: snowflake, options: CreateGuildEmojiOptions): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */\n modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: ModifyGuildEmojiOptions): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */\n deleteGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/emojis': {\n GET: 'listGuildEmojis',\n POST: 'createGuildEmoji',\n },\n '/guilds/{guild.id}/emojis/{emoji.id}': {\n GET: 'getGuildEmoji',\n PATCH: 'modifyGuildEmoji',\n DELETE: 'deleteGuildEmoji',\n },\n})\n\nexport interface GetReactionsOptions {\n /** get users after this user ID */\n after?: snowflake\n /** max number of users to return (1-100) */\n limit?: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#create-reaction */\n createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-own-reaction */\n deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-user-reaction */\n deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#get-reactions */\n getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, options?: GetReactionsOptions): Promise<Reaction[]>\n /** https://discord.com/developers/docs/resources/channel#delete-all-reactions */\n deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji */\n deleteAllReactionsForEmoji(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me': {\n PUT: 'createReaction',\n DELETE: 'deleteOwnReaction',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}': {\n DELETE: 'deleteUserReaction',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}': {\n GET: 'getReactions',\n DELETE: 'deleteAllReactionsforEmoji',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions': {\n DELETE: 'deleteAllReactions',\n },\n})\n", "import { Activity, integer, Internal, snowflake, StatusType } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway#payloads-gateway-payload-structure */\nexport interface GatewayPayloadStructure<O extends GatewayOpcode, T extends keyof GatewayEvents, D> {\n /** opcode for the payload */\n op: O\n /** event data */\n d?: D\n /** the event name for this payload */\n t?: T\n /** sequence number, used for resuming sessions and heartbeats */\n s?: number\n}\n\nexport type GatewayPayload = {\n [O in GatewayOpcode]: O extends GatewayOpcode.DISPATCH\n ? {\n [T in keyof GatewayEvents]: GatewayPayloadStructure<GatewayOpcode.DISPATCH, T, GatewayEvents[T]>\n }[keyof GatewayEvents]\n : GatewayPayloadStructure<O, never, O extends keyof GatewayParams ? GatewayParams[O] : never>\n}[GatewayOpcode]\n\n/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */\nexport enum GatewayOpcode {\n /** An event was dispatched. */\n DISPATCH = 0,\n /** Fired periodically by the client to keep the connection alive. */\n HEARTBEAT = 1,\n /** Starts a new session during the initial handshake. */\n IDENTIFY = 2,\n /** Update the client's presence. */\n PRESENCE_UPDATE = 3,\n /** Used to join/leave or move between voice channels. */\n VOICE_STATE_UPDATE = 4,\n /** Resume a previous session that was disconnected. */\n RESUME = 6,\n /** You should attempt to reconnect and resume immediately. */\n RECONNECT = 7,\n /** Request information about offline guild members in a large guild. */\n REQUEST_GUILD_MEMBERS = 8,\n /** The session has been invalidated. You should reconnect and identify/resume accordingly. */\n INVALID_SESSION = 9,\n /** Sent immediately after connecting, contains the `heartbeat_interval` to use. */\n HELLO = 10,\n /** Sent in response to receiving a heartbeat to acknowledge that it has been received. */\n HEARTBEAT_ACK = 11,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#gateway-intents */\nexport enum GatewayIntent {\n /**\n * - GUILD_CREATE\n * - GUILD_UPDATE\n * - GUILD_DELETE\n * - GUILD_ROLE_CREATE\n * - GUILD_ROLE_UPDATE\n * - GUILD_ROLE_DELETE\n * - CHANNEL_CREATE\n * - CHANNEL_UPDATE\n * - CHANNEL_DELETE\n * - CHANNEL_PINS_UPDATE\n * - THREAD_CREATE\n * - THREAD_UPDATE\n * - THREAD_DELETE\n * - THREAD_LIST_SYNC\n * - THREAD_MEMBER_UPDATE\n * - THREAD_MEMBERS_UPDATE\n * - STAGE_INSTANCE_CREATE\n * - STAGE_INSTANCE_UPDATE\n * - STAGE_INSTANCE_DELETE\n */\n GUILD_CREATE = 1 << 0,\n /**\n * - GUILD_MEMBER_ADD\n * - GUILD_MEMBER_UPDATE\n * - GUILD_MEMBER_REMOVE\n * - THREAD_MEMBERS_UPDATE\n */\n GUILD_MEMBERS = 1 << 1,\n /**\n * - GUILD_BAN_ADD\n * - GUILD_BAN_REMOVE\n */\n GUILD_BANS = 1 << 2,\n /**\n * - GUILD_EMOJIS_UPDATE\n * - GUILD_STICKERS_UPDATE\n */\n GUILD_EMOJIS_AND_STICKERS = 1 << 3,\n /**\n * - GUILD_INTEGRATIONS_UPDATE\n * - INTEGRATION_CREATE\n * - INTEGRATION_UPDATE\n * - INTEGRATION_DELETE\n */\n GUILD_INTEGRATIONS = 1 << 4,\n /**\n * - WEBHOOKS_UPDATE\n */\n GUILD_WEBHOOKS = 1 << 5,\n /**\n * - INVITE_CREATE\n * - INVITE_DELETE\n */\n GUILD_INVITES = 1 << 6,\n /**\n * - VOICE_STATE_UPDATE\n */\n GUILD_VOICE_STATES = 1 << 7,\n /**\n * - PRESENCE_UPDATE\n */\n GUILD_PRESENCES = 1 << 8,\n /**\n * - MESSAGE_CREATE\n * - MESSAGE_UPDATE\n * - MESSAGE_DELETE\n * - MESSAGE_DELETE_BULK\n */\n GUILD_MESSAGES = 1 << 9,\n /**\n * - MESSAGE_REACTION_ADD\n * - MESSAGE_REACTION_REMOVE\n * - MESSAGE_REACTION_REMOVE_ALL\n * - MESSAGE_REACTION_REMOVE_EMOJI\n */\n GUILD_MESSAGE_REACTIONS = 1 << 10,\n /**\n * - TYPING_START\n */\n GUILD_MESSAGE_TYPING = 1 << 11,\n /**\n * - MESSAGE_CREATE\n * - MESSAGE_UPDATE\n * - MESSAGE_DELETE\n * - CHANNEL_PINS_UPDATE\n */\n DIRECT_MESSAGES = 1 << 12,\n /**\n * - MESSAGE_REACTION_ADD\n * - MESSAGE_REACTION_REMOVE\n * - MESSAGE_REACTION_REMOVE_ALL\n * - MESSAGE_REACTION_REMOVE_EMOJI\n */\n DIRECT_MESSAGE_REACTIONS = 1 << 13,\n /**\n * - TYPING_START\n */\n DIRECT_MESSAGE_TYPING = 1 << 14,\n}\n\nexport interface GatewayParams {\n [GatewayOpcode.HELLO]: HelloParams\n [GatewayOpcode.IDENTIFY]: IdentifyParams\n [GatewayOpcode.RESUME]: ResumeParams\n [GatewayOpcode.REQUEST_GUILD_MEMBERS]: RequestGuildMembersParams\n [GatewayOpcode.VOICE_STATE_UPDATE]: VoiceStateUpdateParams\n [GatewayOpcode.PRESENCE_UPDATE]: PresenceUpdateParams\n}\n\n/** https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events */\nexport interface GatewayEvents {}\n\n/** https://discord.com/developers/docs/topics/gateway#identify-identify-structure */\nexport interface IdentifyParams {\n /** authentication token */\n token: string\n /** connection properties */\n properties: object\n /** whether this connection supports compression of packets */\n compress?: boolean\n /** value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list */\n large_threshold?: integer\n /** used for Guild Sharding */\n shard?: [shard_id: integer, num_shards: integer]\n /** presence structure for initial presence information */\n presence?: PresenceUpdateParams\n /** the Gateway Intents you wish to receive */\n intents: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#resume-resume-structure */\nexport interface ResumeParams {\n /** session token */\n token: string\n /** session id */\n session_id: string\n /** last sequence number received */\n seq: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#request-guild-members-guild-request-members-structure */\nexport interface RequestGuildMembersParams {\n /** id of the guild to get members for */\n guild_id: snowflake\n /** string that username starts with, or an empty string to return all members */\n query?: string\n /** maximum number of members to send matching the query; a limit of 0 can be used with an empty string query to return all members */\n limit: integer\n /** used to specify if we want the presences of the matched members */\n presences?: boolean\n /** used to specify which users you wish to fetch */\n user_ids?: snowflake | snowflake[]\n /** nonce to identify the Guild Members Chunk response */\n nonce?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-voice-state-gateway-voice-state-update-structure */\nexport interface VoiceStateUpdateParams {\n /** id of the guild */\n guild_id: snowflake\n /** id of the voice channel client wants to join (null if disconnecting) */\n channel_id?: snowflake\n /** is the client muted */\n self_mute: boolean\n /** is the client deafened */\n self_deaf: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure */\nexport interface PresenceUpdateParams {\n /** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */\n since?: integer\n /** the user's activities */\n activities: Activity[]\n /** the user's new status */\n status: StatusType\n /** whether or not the client is afk */\n afk: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#hello-hello-structure */\nexport interface HelloParams {\n /** the interval (in milliseconds) the client should heartbeat with */\n heartbeat_interval: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#session-start-limit-object-session-start-limit-structure */\nexport interface SessionStartLimit {\n /** The total number of session starts the current user is allowed */\n total: integer\n /** The remaining number of session starts the current user is allowed */\n remaining: integer\n /** The number of milliseconds after which the limit resets */\n reset_after: integer\n /** The number of identify requests allowed per 5 seconds */\n max_concurrency: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/topics/gateway#get-gateway */\n getGateway(): Promise<any>\n /** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */\n getGatewayBot(): Promise<any>\n }\n}\n\nInternal.define({\n '/gateway': {\n GET: 'getGateway',\n },\n '/gateway/bot': {\n GET: 'getGatewayBot',\n },\n})\n", "import { integer, Internal, PresenceUpdateParams, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */\nexport interface GuildMember {\n /** the user this guild member represents */\n user?: User\n /** this users guild nickname */\n nick?: string\n /** the member's guild avatar hash */\n avatar?: string\n /** array of role object ids */\n roles: snowflake[]\n /** when the user joined the guild */\n joined_at: timestamp\n /** when the user started boosting the guild */\n premium_since?: timestamp\n /** whether the user is deafened in voice channels */\n deaf: boolean\n /** whether the user is muted in voice channels */\n mute: boolean\n /** whether the user has not yet passed the guild's Membership Screening requirements */\n pending?: boolean\n /** total permissions of the member in the channel, including overwrites, returned when in the interaction object */\n permissions?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-add-guild-member-add-extra-fields */\nexport interface GuildMemberAddEvent extends GuildMember {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-remove-guild-member-remove-event-fields */\nexport interface GuildMemberRemoveEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the user who was removed */\n user: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-update-guild-member-update-event-fields */\nexport interface GuildMemberUpdateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** user role ids */\n roles: snowflake[]\n /** the user */\n user: User\n /** nickname of the user in the guild */\n nick?: string\n /** the member's guild avatar hash */\n avatar?: string\n /** when the user joined the guild */\n joined_at?: timestamp\n /** when the user starting boosting the guild */\n premium_since?: timestamp\n /** whether the user is deafened in voice channels */\n deaf?: boolean\n /** whether the user is muted in voice channels */\n mute?: boolean\n /** whether the user has not yet passed the guild's Membership Screening requirements */\n pending?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-members-chunk-guild-members-chunk-event-fields */\nexport interface GuildMembersChunkEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** set of guild members */\n members: GuildMember[]\n /** the chunk index in the expected chunks for this response (0 <= chunk_index < chunk_count) */\n chunk_index: integer\n /** the total number of expected chunks for this response */\n chunk_count: integer\n /** if passing an invalid id to REQUEST_GUILD_MEMBERS, it will be returned here */\n not_found?: snowflake[]\n /** if passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here */\n presences?: PresenceUpdateParams[]\n /** the nonce used in the Guild Members Request */\n nonce?: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new user joined a guild */\n GUILD_MEMBER_ADD: GuildMemberAddEvent\n /** user was removed from a guild */\n GUILD_MEMBER_REMOVE: GuildMemberRemoveEvent\n /** guild member was updated */\n GUILD_MEMBER_UPDATE: GuildMemberUpdateEvent\n /** response to Request Guild Members */\n GUILD_MEMBERS_CHUNK: GuildMembersChunkEvent\n }\n}\n\nexport interface ListGuildMembersOptions {\n /** max number of members to return (1-1000) */\n limit?: integer\n /** the highest user id in the previous page */\n after?: snowflake\n}\n\nexport interface SearchGuildMembersOptions {\n /** query string to match username(s) and nickname(s) against */\n query: string\n /** max number of members to return (1-1000) */\n limit?: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild-member */\n getGuildMember(guild_id: snowflake, user_id: snowflake): Promise<GuildMember>\n /** https://discord.com/developers/docs/resources/guild#list-guild-members */\n listGuildMembers(guild_id: snowflake, options?: ListGuildMembersOptions): Promise<GuildMember[]>\n /** https://discord.com/developers/docs/resources/guild#search-guild-members */\n searchGuildMembers(guild_id: snowflake, options: SearchGuildMembersOptions): Promise<GuildMember[]>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/members/{user.id}': {\n GET: 'getGuildMember',\n PUT: 'addGuildMember',\n PATCH: 'modifyGuildMember',\n DELETE: 'removeGuildMember',\n },\n '/guilds/{guild.id}/members': {\n GET: 'listGuildMembers',\n },\n '/guilds/{guild.id}/members/search': {\n GET: 'searchGuildMembers',\n },\n '/guilds/{guild.id}/members/@me': {\n PATCH: 'modifyCurrentMember',\n },\n '/guilds/{guild.id}/members/@me/nick': {\n PATCH: 'modifyCurrentUserNick',\n },\n '/guilds/{guild.id}/members/{user.id}/roles/{role.id}': {\n PUT: 'addGuildMemberRole',\n DELETE: 'removeGuildMemberRole',\n },\n})\n", "import { Guild, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure */\nexport interface GuildTemplate {\n /** the template code (unique ID) */\n code: string\n /** template name */\n name: string\n /** the description for the template */\n description?: string\n /** number of times this template has been used */\n usage_count: integer\n /** the ID of the user who created the template */\n creator_id: snowflake\n /** the user who created the template */\n creator: User\n /** when this template was created */\n created_at: timestamp\n /** when this template was last synced to the source guild */\n updated_at: timestamp\n /** the ID of the guild this template is based on */\n source_guild_id: snowflake\n /** the guild snapshot this template contains */\n serialized_source_guild: Partial<Guild>\n /** whether the template has unsynced changes */\n is_dirty?: boolean\n}\n\nInternal.define({\n '/guilds/templates/{template.code}': {\n GET: 'getGuildTemplate',\n POST: 'createGuildfromGuildTemplate',\n },\n '/guilds/{guild.id}/templates': {\n GET: 'getGuildTemplates',\n POST: 'createGuildTemplate',\n },\n '/guilds/{guild.id}/templates/{template.code}': {\n PUT: 'syncGuildTemplate',\n PATCH: 'modifyGuildTemplate',\n DELETE: 'deleteGuildTemplate',\n },\n})\n", "import { Channel, Emoji, GuildMember, integer, Internal, PresenceUpdateEvent, Role, snowflake, StageInstance, Sticker, timestamp, User, VoiceState } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */\nexport interface Guild {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters, excluding trailing and leading whitespace) */\n name: string\n /** icon hash */\n icon?: string\n /** icon hash, returned when in the template object */\n icon_hash?: string\n /** splash hash */\n splash?: string\n /** discovery splash hash; only present for guilds with the \"DISCOVERABLE\" feature */\n discovery_splash?: string\n /** true if the user is the owner of the guild */\n owner?: boolean\n /** id of owner */\n owner_id: snowflake\n /** total permissions for the user in the guild (excludes overwrites) */\n permissions?: string\n /** voice region id for the guild (deprecated) */\n region?: string\n /** id of afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout: integer\n /** true if the server widget is enabled */\n widget_enabled?: boolean\n /** the channel id that the widget will generate an invite to, or null if set to no invite */\n widget_channel_id?: snowflake\n /** verification level required for the guild */\n verification_level: integer\n /** default message notifications level */\n default_message_notifications: integer\n /** explicit content filter level */\n explicit_content_filter: integer\n /** roles in the guild */\n roles: Role[]\n /** custom guild emojis */\n emojis: Emoji[]\n /** enabled guild features */\n features: GuildFeature[]\n /** required MFA level for the guild */\n mfa_level: integer\n /** application id of the guild creator if it is bot-created */\n application_id?: snowflake\n /** the id of the channel where guild notices such as welcome messages and boost events are posted */\n system_channel_id?: snowflake\n /** system channel flags */\n system_channel_flags: integer\n /** the id of the channel where Community guilds can display rules and/or guidelines */\n rules_channel_id?: snowflake\n /** when this guild was joined at */\n joined_at?: timestamp\n /** true if this is considered a large guild */\n large?: boolean\n /** true if this guild is unavailable due to an outage */\n unavailable?: boolean\n /** total number of members in this guild */\n member_count?: integer\n /** states of members currently in voice channels; lacks the guild_id key */\n voice_states?: Partial<VoiceState>[]\n /** users in the guild */\n members?: GuildMember[]\n /** channels in the guild */\n channels?: Channel[]\n /** all active threads in the guild that current user has permission to view */\n threads?: Channel[]\n /** presences of the members in the guild, will only include non-offline members if the size is greater than large threshold */\n presences?: Partial<PresenceUpdateEvent>[]\n /** the maximum number of presences for the guild (null is always returned, apart from the largest of guilds) */\n max_presences?: integer\n /** the maximum number of members for the guild */\n max_members?: integer\n /** the vanity url code for the guild */\n vanity_url_code?: string\n /** the description of a Community guild */\n description?: string\n /** banner hash */\n banner?: string\n /** premium tier (Server Boost level) */\n premium_tier: integer\n /** the number of boosts this guild currently has */\n premium_subscription_count?: integer\n /** the preferred locale of a Community guild; used in server discovery and notices from Discord; defaults to \"en-US\" */\n preferred_locale: string\n /** the id of the channel where admins and moderators of Community guilds receive notices from Discord */\n public_updates_channel_id?: snowflake\n /** the maximum amount of users in a video channel */\n max_video_channel_users?: integer\n /** approximate number of members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */\n approximate_member_count?: integer\n /** approximate number of non-offline members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */\n approximate_presence_count?: integer\n /** the welcome screen of a Community guild, shown to new members, returned in an Invite's guild object */\n welcome_screen?: WelcomeScreen\n /** guild NSFW level */\n nsfw_level: integer\n /** Stage instances in the guild */\n stage_instances?: StageInstance[]\n /** custom guild stickers */\n stickers?: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags */\nexport enum SystemChannelFlag {\n /** Suppress member join notifications */\n SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,\n /** Suppress server boost notifications */\n SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,\n /** Suppress server setup tips */\n SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-guild-features */\nexport enum GuildFeature {\n /** guild has access to set an animated guild icon */\n ANIMATED_ICON = 'ANIMATED_ICON',\n /** guild has access to set a guild banner image */\n BANNER = 'BANNER',\n /** guild has access to use commerce features (i.e. create store channels) */\n COMMERCE = 'COMMERCE',\n /** guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates */\n COMMUNITY = 'COMMUNITY',\n /** guild is able to be discovered in the directory */\n DISCOVERABLE = 'DISCOVERABLE',\n /** guild is able to be featured in the directory */\n FEATURABLE = 'FEATURABLE',\n /** guild has access to set an invite splash background */\n INVITE_SPLASH = 'INVITE_SPLASH',\n /** guild has enabled Membership Screening */\n MEMBER_VERIFICATION_GATE_ENABLED = 'MEMBER_VERIFICATION_GATE_ENABLED',\n /** guild has enabled monetization */\n MONETIZATION_ENABLED = 'MONETIZATION_ENABLED',\n /** guild has increased custom sticker slots */\n MORE_STICKERS = 'MORE_STICKERS',\n /** guild has access to create news channels */\n NEWS = 'NEWS',\n /** guild is partnered */\n PARTNERED = 'PARTNERED',\n /** guild can be previewed before joining via Membership Screening or the directory */\n PREVIEW_ENABLED = 'PREVIEW_ENABLED',\n /** guild has access to create private threads */\n PRIVATE_THREADS = 'PRIVATE_THREADS',\n /** guild is able to set role icons */\n ROLE_ICONS = 'ROLE_ICONS',\n /** guild has access to the seven day archive time for threads */\n SEVEN_DAY_THREAD_ARCHIVE = 'SEVEN_DAY_THREAD_ARCHIVE',\n /** guild has access to the three day archive time for threads */\n THREE_DAY_THREAD_ARCHIVE = 'THREE_DAY_THREAD_ARCHIVE',\n /** guild has enabled ticketed events */\n TICKETED_EVENTS_ENABLED = 'TICKETED_EVENTS_ENABLED',\n /** guild has access to set a vanity URL */\n VANITY_URL = 'VANITY_URL',\n /** guild is verified */\n VERIFIED = 'VERIFIED',\n /** guild has access to set 384kbps bitrate in voice (previously VIP voice servers) */\n VIP_REGIONS = 'VIP_REGIONS',\n /** guild has enabled the welcome screen */\n WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */\nexport interface GuildPreview {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters) */\n name: string\n /** icon hash */\n icon?: string\n /** splash hash */\n splash?: string\n /** discovery splash hash */\n discovery_splash?: string\n /** custom guild emojis */\n emojis: Emoji[]\n /** enabled guild features */\n features: GuildFeature[]\n /** approximate number of members in this guild */\n approximate_member_count: integer\n /** approximate number of online members in this guild */\n approximate_presence_count: integer\n /** the description for the guild, if the guild is discoverable */\n description?: string\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */\nexport interface GuildWidget {\n /** whether the widget is enabled */\n enabled: boolean\n /** the widget channel id */\n channel_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/resources/guild#ban-object-ban-structure */\nexport interface Ban {\n /** the reason for the ban */\n reason?: string\n /** the banned user */\n user: User\n}\n\n/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */\nexport interface WelcomeScreen {\n /** the server description shown in the welcome screen */\n description?: string\n /** the channels shown in the welcome screen, up to 5 */\n welcome_channels: WelcomeScreenChannel[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */\nexport interface WelcomeScreenChannel {\n /** the channel's id */\n channel_id: snowflake\n /** the description shown for the channel */\n description: string\n /** the emoji id, if the emoji is custom */\n emoji_id?: snowflake\n /** the emoji name if custom, the unicode character if standard, or null if no emoji is set */\n emoji_name?: string\n}\n\nexport interface GuildCreateEvent extends Guild {}\n\nexport interface GuildUpdateEvent extends Guild {}\n\nexport interface GuildDeleteEvent extends Guild {}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-ban-add-guild-ban-add-event-fields */\nexport interface GuildBanAddEvent {\n /** id of the guild */\n guild_id: snowflake\n /** the banned user */\n user: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-ban-remove-guild-ban-remove-event-fields */\nexport interface GuildBanRemoveEvent {\n /** id of the guild */\n guild_id: snowflake\n /** the unbanned user */\n user: User\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** lazy-load for unavailable guild, guild became available, or user joined a new guild */\n GUILD_CREATE: GuildCreateEvent\n /** guild was updated */\n GUILD_UPDATE: GuildUpdateEvent\n /** guild became unavailable, or user left/was removed from a guild */\n GUILD_DELETE: GuildDeleteEvent\n /** user was banned from a guild */\n GUILD_BAN_ADD: GuildBanAddEvent\n /** user was unbanned from a guild */\n GUILD_BAN_REMOVE: GuildBanRemoveEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/user#get-current-user-guilds */\n getCurrentUserGuilds(): Promise<Guild[]>\n /** https://discord.com/developers/docs/resources/user#leave-guild */\n leaveGuild(guild_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/users/@me/guilds': {\n GET: 'getCurrentUserGuilds',\n },\n '/users/@me/guilds/{guild.id}': {\n DELETE: 'leaveGuild',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild */\n getGuild(guild_id: snowflake): Promise<Guild>\n /** https://discord.com/developers/docs/resources/guild#get-guild-preview */\n getGuildPreview(guild_id: snowflake): Promise<GuildPreview>\n /** https://discord.com/developers/docs/resources/guild#modify-guild */\n modifyGuild(guild_id: snowflake, options: Partial<Guild>): Promise<Guild>\n }\n}\n\nInternal.define({\n '/guilds': {\n POST: 'createGuild',\n },\n '/guilds/{guild.id}': {\n GET: 'getGuild',\n PATCH: 'modifyGuild',\n DELETE: 'deleteGuild',\n },\n '/guilds/{guild.id}/preview': {\n GET: 'getGuildPreview',\n },\n '/guilds/{guild.id}/threads/active': {\n GET: 'listActiveThreads',\n },\n '/guilds/{guild.id}/bans': {\n GET: 'getGuildBans',\n },\n '/guilds/{guild.id}/bans/{user.id}': {\n GET: 'getGuildBan',\n PUT: 'createGuildBan',\n DELETE: 'removeGuildBan',\n },\n '/guilds/{guild.id}/roles': {\n GET: 'getGuildRoles',\n POST: 'createGuildRole',\n PATCH: 'modifyGuildRolePositions',\n },\n '/guilds/{guild.id}/roles/{role.id}': {\n PATCH: 'modifyGuildRole',\n DELETE: 'deleteGuildRole',\n },\n '/guilds/{guild.id}/prune': {\n GET: 'getGuildPruneCount',\n POST: 'beginGuildPrune',\n },\n '/guilds/{guild.id}/regions': {\n GET: 'getGuildVoiceRegions',\n },\n '/guilds/{guild.id}/invites': {\n GET: 'getGuildInvites',\n },\n '/guilds/{guild.id}/integrations': {\n GET: 'getGuildIntegrations',\n },\n '/guilds/{guild.id}/integrations/{integration.id}': {\n DELETE: 'deleteGuildIntegration',\n },\n '/guilds/{guild.id}/widget': {\n GET: 'getGuildWidgetSettings',\n PATCH: 'modifyGuildWidget',\n },\n '/guilds/{guild.id}/widget.json': {\n GET: 'getGuildWidget',\n },\n '/guilds/{guild.id}/vanity-url': {\n GET: 'getGuildVanityURL',\n },\n '/guilds/{guild.id}/widget.png': {\n GET: 'getGuildWidgetImage',\n },\n '/guilds/{guild.id}/welcome-screen': {\n GET: 'getGuildWelcomeScreen',\n PATCH: 'modifyGuildWelcomeScreen',\n },\n '/guilds/{guild.id}/voice-states/@me': {\n PATCH: 'modifyCurrentUserVoiceState',\n },\n '/guilds/{guild.id}/voice-states/{user.id}': {\n PATCH: 'modifyUserVoiceState',\n },\n})\n", "import { integer, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */\nexport interface Integration {\n /** integration id */\n id: snowflake\n /** integration name */\n name: string\n /** integration type (twitch, youtube, or discord) */\n type: string\n /** is this integration enabled */\n enabled: boolean\n /** is this integration syncing */\n syncing?: boolean\n /** id that this integration uses for \"subscribers\" */\n role_id?: snowflake\n /** whether emoticons should be synced for this integration (twitch only currently) */\n enable_emoticons?: boolean\n /** the behavior of expiring subscribers */\n expire_behavior?: IntegrationExpireBehavior\n /** the grace period (in days) before expiring subscribers */\n expire_grace_period?: integer\n /** user for this integration */\n user?: User\n /** integration account information */\n account: IntegrationAccount\n /** when this integration was last synced */\n synced_at?: timestamp\n /** how many subscribers this integration has */\n subscriber_count?: integer\n /** has this integration been revoked */\n revoked?: boolean\n /** The bot/OAuth2 application for discord integrations */\n application?: IntegrationApplication\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */\nexport enum IntegrationExpireBehavior {\n REMOVE_ROLE = 0,\n KICK = 1,\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */\nexport interface IntegrationAccount {\n /** id of the account */\n id: string\n /** name of the account */\n name: string\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */\nexport interface IntegrationApplication {\n /** the id of the app */\n id: snowflake\n /** the name of the app */\n name: string\n /** the icon hash of the app */\n icon?: string\n /** the description of the app */\n description: string\n /** the summary of the app */\n summary: string\n /** the bot associated with this application */\n bot?: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-integrations-update-guild-integrations-update-event-fields */\nexport interface GuildIntegrationsUpdateEvent {\n /** id of the guild whose integrations were updated */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-create-integration-create-event-additional-fields */\nexport interface IntegrationCreateEvent extends Integration {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-update-integration-update-event-additional-fields */\nexport interface IntegrationUpdateEvent extends Integration {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-delete-integration-delete-event-fields */\nexport interface IntegrationDeleteEvent {\n /** integration id */\n id: snowflake\n /** id of the guild */\n guild_id: snowflake\n /** id of the bot/OAuth2 application for this discord integration */\n application_id?: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild integration was updated */\n GUILD_INTEGRATIONS_UPDATE: GuildIntegrationsUpdateEvent\n /** guild integration was created */\n INTEGRATION_CREATE: IntegrationCreateEvent\n /** guild integration was updated */\n INTEGRATION_UPDATE: IntegrationUpdateEvent\n /** guild integration was deleted */\n INTEGRATION_DELETE: IntegrationDeleteEvent\n }\n}\n", "import { AllowedMentions, ApplicationCommandInteractionDataOption, Channel, Component, Embed, GuildMember, integer, Internal, Message, Role, SelectOption, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */\nexport interface Interaction {\n /** id of the interaction */\n id: snowflake\n /** id of the application this interaction is for */\n application_id: snowflake\n /** the type of interaction */\n type: InteractionType\n /** the command data payload */\n data?: InteractionData\n /** the guild it was sent from */\n guild_id?: snowflake\n /** the channel it was sent from */\n channel_id?: snowflake\n /** guild member data for the invoking user, including permissions */\n member?: GuildMember\n /** user object for the invoking user, if invoked in a DM */\n user?: User\n /** a continuation token for responding to the interaction */\n token: string\n /** read-only property, always 1 */\n version: integer\n /** for components, the message they were attached to */\n message?: Message\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type */\nexport enum InteractionType {\n PING = 1,\n APPLICATION_COMMAND = 2,\n MESSAGE_COMPONENT = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure */\nexport interface InteractionData {\n /** the ID of the invoked command */\n id: snowflake\n /** the name of the invoked command */\n name: string\n /** the type of the invoked command */\n type: integer\n /** converted users + roles + channels */\n resolved?: ResolvedData\n /** the params + values from the user */\n options?: ApplicationCommandInteractionDataOption[]\n /** the custom_id of the component */\n custom_id?: string\n /** the type of the component */\n component_type?: integer\n /** the values the user selected */\n values?: SelectOption[]\n /** id the of user or message targetted by a user or message command */\n target_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */\nexport interface ResolvedData {\n /** the ids and User objects */\n users?: Record<snowflake, User>\n /** the ids and partial Member objects */\n members?: Record<snowflake, Partial<GuildMember>>\n /** the ids and Role objects */\n roles?: Record<snowflake, Role>\n /** the ids and partial Channel objects */\n channels?: Record<snowflake, Partial<Channel>>\n /** the ids and partial Message objects */\n messages?: Record<snowflake, Partial<Message>>\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure */\nexport interface MessageInteraction {\n /** id of the interaction */\n id: snowflake\n /** the type of interaction */\n type: InteractionType\n /** the name of the application command */\n name: string\n /** the user who invoked the interaction */\n user: User\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */\nexport interface InteractionResponse {\n /** the type of response */\n type: InteractionCallbackType\n /** an optional response message */\n data?: InteractionCallbackData\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */\nexport enum InteractionCallbackType {\n /** ACK a Ping */\n PONG = 1,\n /** respond to an interaction with a message */\n CHANNEL_MESSAGE_WITH_SOURCE = 4,\n /** ACK an interaction and edit a response later, the user sees a loading state */\n DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5,\n /** for components, ACK an interaction and edit the original message later; the user does not see a loading state */\n DEFERRED_UPDATE_MESSAGE = 6,\n /** for components, edit the message the component was attached to */\n UPDATE_MESSAGE = 7,\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure */\nexport interface InteractionCallbackData {\n /** is the response TTS */\n tts?: boolean\n /** message content */\n content?: string\n /** supports up to 10 embeds */\n embeds?: Embed[]\n /** allowed mentions object */\n allowed_mentions?: AllowedMentions\n /** interaction callback data flags */\n flags?: integer\n /** message components */\n components?: Component[]\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-flags */\nexport enum InteractionCallbackDataFlag {\n /** only the user receiving the message can see it */\n EPHEMERAL = 1 << 6,\n}\n\nexport interface InteractionCreateEvent extends Interaction {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user used an interaction, such as an Application Command */\n INTERACTION_CREATE: InteractionCreateEvent\n }\n}\n\nInternal.define({\n '/interactions/{interaction.id}/{interaction.token}/callback': {\n POST: 'createInteractionResponse',\n },\n '/webhooks/{application.id}/{interaction.token}/messages/@original': {\n GET: 'getOriginalInteractionResponse',\n PATCH: 'editOriginalInteractionResponse',\n DELETE: 'deleteOriginalInteractionResponse',\n },\n '/webhooks/{application.id}/{interaction.token}': {\n POST: 'createFollowupMessage',\n },\n '/webhooks/{application.id}/{interaction.token}/messages/{message.id}': {\n GET: 'getFollowupMessage',\n PATCH: 'editFollowupMessage',\n DELETE: 'deleteFollowupMessage',\n },\n})\n", "import { Application, Channel, Guild, GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/invite#invite-object-invite-structure */\nexport interface Invite {\n /** the invite code (unique ID) */\n code: string\n /** the guild this invite is for */\n guild?: Partial<Guild>\n /** the channel this invite is for */\n channel: Partial<Channel>\n /** the user who created the invite */\n inviter?: User\n /** the type of target for this voice channel invite */\n target_type?: integer\n /** the user whose stream to display for this voice channel stream invite */\n target_user?: User\n /** the embedded application to open for this voice channel embedded application invite */\n target_application?: Partial<Application>\n /** approximate count of online members, returned from the GET /invites/<code> endpoint when with_counts is true */\n approximate_presence_count?: integer\n /** approximate count of total members, returned from the GET /invites/<code> endpoint when with_counts is true */\n approximate_member_count?: integer\n /** the expiration date of this invite, returned from the GET /invites/<code> endpoint when with_expiration is true */\n expires_at?: timestamp\n /** stage instance data if there is a public Stage instance in the Stage channel this invite is for */\n stage_instance?: InviteStageInstance\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */\nexport enum InviteTargetType {\n STREAM = 1,\n EMBEDDED_APPLICATION = 2,\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure */\nexport interface InviteMetadata {\n /** number of times this invite has been used */\n uses: integer\n /** max number of times this invite can be used */\n max_uses: integer\n /** duration (in seconds) after which the invite expires */\n max_age: integer\n /** whether this invite only grants temporary membership */\n temporary: boolean\n /** when this invite was created */\n created_at: timestamp\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure */\nexport interface InviteStageInstance {\n /** the members speaking in the Stage */\n members: Partial<GuildMember>[]\n /** the number of users in the Stage */\n participant_count: integer\n /** the number of users speaking in the Stage */\n speaker_count: integer\n /** the topic of the Stage instance (1-120 characters) */\n topic: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#invite-create-invite-create-event-fields */\nexport interface InviteCreateEvent {\n /** the channel the invite is for */\n channel_id: snowflake\n /** the unique invite code */\n code: string\n /** the time at which the invite was created */\n created_at: timestamp\n /** the guild of the invite */\n guild_id?: snowflake\n /** the user that created the invite */\n inviter?: User\n /** how long the invite is valid for (in seconds) */\n max_age: integer\n /** the maximum number of times the invite can be used */\n max_uses: integer\n /** the type of target for this voice channel invite */\n target_type?: integer\n /** the user whose stream to display for this voice channel stream invite */\n target_user?: User\n /** the embedded application to open for this voice channel embedded application invite */\n target_application?: Partial<Application>\n /** whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) */\n temporary: boolean\n /** how many times the invite has been used (always will be 0) */\n uses: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#invite-delete-invite-delete-event-fields */\nexport interface InviteDeleteEvent {\n /** the channel of the invite */\n channel_id: snowflake\n /** the guild of the invite */\n guild_id?: snowflake\n /** the unique invite code */\n code: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** invite to a channel was created */\n INVITE_CREATE: InviteCreateEvent\n /** invite to a channel was deleted */\n INVITE_DELETE: InviteDeleteEvent\n }\n}\n\nexport interface GetInviteOptions {\n /** whether to include invite metadata */\n with_counts?: boolean\n /** whether to include invite expiration date */\n with_expiration?: boolean\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/invite#get-invite */\n getInvite(code: string, options?: GetInviteOptions): Promise<Invite>\n /** https://discord.com/developers/docs/resources/invite#delete-invite */\n deleteInvite(code: string): Promise<Invite>\n }\n}\n\nInternal.define({\n '/invites/{invite.code}': {\n GET: 'getInvite',\n DELETE: 'deleteInvite',\n },\n})\n", "import { Application, Channel, ChannelType, Component, GuildMember, integer, Internal, MessageInteraction, Reaction, snowflake, Sticker, StickerItem, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-structure */\nexport interface Message {\n /** id of the message */\n id: snowflake\n /** id of the channel the message was sent in */\n channel_id: snowflake\n /** id of the guild the message was sent in */\n guild_id?: snowflake\n /** the author of this message (not guaranteed to be a valid user, see below) */\n author: User\n /** member properties for this message's author */\n member?: Partial<GuildMember>\n /** contents of the message */\n content: string\n /** when this message was sent */\n timestamp: timestamp\n /** when this message was edited (or null if never) */\n edited_timestamp?: timestamp\n /** whether this was a TTS message */\n tts: boolean\n /** whether this message mentions everyone */\n mention_everyone: boolean\n /** users specifically mentioned in the message */\n mentions: User[]\n /** roles specifically mentioned in this message */\n mention_roles: snowflake[]\n /** channels specifically mentioned in this message */\n mention_channels?: ChannelMention[]\n /** any attached files */\n attachments: Attachment[]\n /** any embedded content */\n embeds: Embed[]\n /** reactions to the message */\n reactions?: Reaction[]\n /** used for validating a message was sent */\n nonce?: integer | string\n /** whether this message is pinned */\n pinned: boolean\n /** if the message is generated by a webhook, this is the webhook's id */\n webhook_id?: snowflake\n /** type of message */\n type: integer\n /** sent with Rich Presence-related chat embeds */\n activity?: MessageActivity\n /** sent with Rich Presence-related chat embeds */\n application?: Partial<Application>\n /** if the message is a response to an Interaction, this is the id of the interaction's application */\n application_id?: snowflake\n /** data showing the source of a crosspost, channel follow add, pin, or reply message */\n message_reference?: MessageReference\n /** message flags combined as a bitfield */\n flags?: integer\n /** the message associated with the message_reference */\n referenced_message?: Message\n /** sent if the message is a response to an Interaction */\n interaction?: MessageInteraction\n /** the thread that was started from this message, includes thread member object */\n thread?: Channel\n /** sent if the message contains components like buttons, action rows, or other interactive components */\n components?: Component[]\n /** sent if the message contains stickers */\n sticker_items?: StickerItem[]\n /** Deprecated the stickers sent with the message */\n stickers?: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-types */\nexport enum MessageType {\n DEFAULT = 0,\n RECIPIENT_ADD = 1,\n RECIPIENT_REMOVE = 2,\n CALL = 3,\n CHANNEL_NAME_CHANGE = 4,\n CHANNEL_ICON_CHANGE = 5,\n CHANNEL_PINNED_MESSAGE = 6,\n GUILD_MEMBER_JOIN = 7,\n USER_PREMIUM_GUILD_SUBSCRIPTION = 8,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11,\n CHANNEL_FOLLOW_ADD = 12,\n GUILD_DISCOVERY_DISQUALIFIED = 14,\n GUILD_DISCOVERY_REQUALIFIED = 15,\n GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16,\n GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING = 17,\n THREAD_CREATED = 18,\n REPLY = 19,\n CHAT_INPUT_COMMAND = 20,\n THREAD_STARTER_MESSAGE = 21,\n GUILD_INVITE_REMINDER = 22,\n CONTEXT_MENU_COMMAND = 23,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */\nexport interface MessageActivity {\n /** type of message activity */\n type: integer\n /** party_id from a Rich Presence event */\n party_id?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-types */\nexport enum MessageActivityType {\n JOIN = 1,\n SPECTATE = 2,\n LISTEN = 3,\n JOIN_REQUEST = 5,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-flags */\nexport enum MessageFlag {\n /** this message has been published to subscribed channels (via Channel Following) */\n CROSSPOSTED = 1 << 0,\n /** this message originated from a message in another channel (via Channel Following) */\n IS_CROSSPOST = 1 << 1,\n /** do not include any embeds when serializing this message */\n SUPPRESS_EMBEDS = 1 << 2,\n /** the source message for this crosspost has been deleted (via Channel Following) */\n SOURCE_MESSAGE_DELETED = 1 << 3,\n /** this message came from the urgent message system */\n URGENT = 1 << 4,\n /** this message has an associated thread, with the same id as the message */\n HAS_THREAD = 1 << 5,\n /** this message is only visible to the user who invoked the Interaction */\n EPHEMERAL = 1 << 6,\n /** this message is an Interaction Response and the bot is \"thinking\" */\n LOADING = 1 << 7,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */\nexport interface MessageReference {\n /** id of the originating message */\n message_id?: snowflake\n /** id of the originating message's channel */\n channel_id?: snowflake\n /** id of the originating message's guild */\n guild_id?: snowflake\n /** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */\n fail_if_not_exists?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-structure */\nexport interface Embed {\n /** title of embed */\n title?: string\n /** type of embed (always \"rich\" for webhook embeds) */\n type?: string\n /** description of embed */\n description?: string\n /** url of embed */\n url?: string\n /** timestamp of embed content */\n timestamp?: timestamp\n /** color code of the embed */\n color?: integer\n /** footer information */\n footer?: EmbedFooter\n /** image information */\n image?: EmbedImage\n /** thumbnail information */\n thumbnail?: EmbedThumbnail\n /** video information */\n video?: EmbedVideo\n /** provider information */\n provider?: EmbedProvider\n /** author information */\n author?: EmbedAuthor\n /** fields information */\n fields?: EmbedField[]\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */\nexport interface EmbedThumbnail {\n /** source url of thumbnail (only supports http(s) and attachments) */\n url: string\n /** a proxied url of the thumbnail */\n proxy_url?: string\n /** height of thumbnail */\n height?: integer\n /** width of thumbnail */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure */\nexport interface EmbedVideo {\n /** source url of video */\n url?: string\n /** a proxied url of the video */\n proxy_url?: string\n /** height of video */\n height?: integer\n /** width of video */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure */\nexport interface EmbedImage {\n /** source url of image (only supports http(s) and attachments) */\n url: string\n /** a proxied url of the image */\n proxy_url?: string\n /** height of image */\n height?: integer\n /** width of image */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure */\nexport interface EmbedProvider {\n /** name of provider */\n name?: string\n /** url of provider */\n url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure */\nexport interface EmbedAuthor {\n /** name of author */\n name: string\n /** url of author */\n url?: string\n /** url of author icon (only supports http(s) and attachments) */\n icon_url?: string\n /** a proxied url of author icon */\n proxy_icon_url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure */\nexport interface EmbedFooter {\n /** footer text */\n text: string\n /** url of footer icon (only supports http(s) and attachments) */\n icon_url?: string\n /** a proxied url of footer icon */\n proxy_icon_url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure */\nexport interface EmbedField {\n /** name of the field */\n name: string\n /** value of the field */\n value: string\n /** whether or not this field should display inline */\n inline?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure */\nexport interface Attachment {\n /** attachment id */\n id: snowflake\n /** name of file attached */\n filename: string\n /** the attachment's media type */\n content_type?: string\n /** size of file in bytes */\n size: integer\n /** source url of file */\n url: string\n /** a proxied url of file */\n proxy_url: string\n /** height of file (if image) */\n height?: integer\n /** width of file (if image) */\n width?: integer\n /** whether this attachment is ephemeral */\n ephemeral?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure */\nexport interface ChannelMention {\n /** id of the channel */\n id: snowflake\n /** id of the guild containing the channel */\n guild_id: snowflake\n /** the type of channel */\n type: ChannelType\n /** the name of the channel */\n name: string\n}\n\nexport interface MessageCreateEvent extends Message {}\n\nexport interface MessageUpdateEvent extends Message {}\n\n/** https://discord.com/developers/docs/topics/gateway#message-delete-message-delete-event-fields */\nexport interface MessageDeleteEvent {\n /** the id of the message */\n id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-delete-bulk-message-delete-bulk-event-fields */\nexport interface MessageDeleteBulkEvent {\n /** the ids of the messages */\n ids: snowflake[]\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** message was created */\n MESSAGE_CREATE: MessageCreateEvent\n /** message was edited */\n MESSAGE_UPDATE: MessageUpdateEvent\n /** message was deleted */\n MESSAGE_DELETE: MessageDeleteEvent\n /** multiple messages were deleted at once */\n MESSAGE_DELETE_BULK: MessageDeleteBulkEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#get-channel-messages */\n getChannelMessages(channel_id: snowflake): Promise<Message[]>\n /** https://discord.com/developers/docs/resources/channel#get-channel-message */\n getChannelMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#create-message */\n createMessage(channel_id: snowflake, data: Partial<Message>): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#crosspost-message */\n crosspostMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#edit-message */\n editMessage(channel_id: snowflake, message_id: snowflake, data: Partial<Message>): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#delete-message */\n deleteMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */\n bulkDeleteMessages(channel_id: snowflake, message_ids: snowflake[]): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages': {\n GET: 'getChannelMessages',\n POST: 'createMessage',\n },\n '/channels/{channel.id}/messages/{message.id}': {\n GET: 'getChannelMessage',\n PATCH: 'editMessage',\n DELETE: 'deleteMessage',\n },\n '/channels/{channel.id}/messages/{message.id}/crosspost': {\n POST: 'crosspostMessage',\n },\n '/channels/{channel.id}/messages/bulk-delete': {\n POST: 'bulkDeleteMessages',\n },\n})\n", "import { Emoji, integer, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields */\nexport interface PresenceUpdateEvent {\n /** the user presence is being updated for */\n user: User\n /** id of the guild */\n guild_id: snowflake\n /** either \"idle\", \"dnd\", \"online\", or \"offline\" */\n status: StatusType\n /** user's current activities */\n activities: Activity[]\n /** user's platform-dependent status */\n client_status: ClientStatus\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-presence-status-types */\nexport enum StatusType {\n /** Online */\n ONLINE = 'ONLINE',\n /** Do Not Disturb */\n DND = 'DND',\n /** AFK */\n IDLE = 'IDLE',\n /** Invisible and shown as offline */\n INVISIBLE = 'INVISIBLE',\n /** Offline */\n OFFLINE = 'OFFLINE',\n}\n\n/** https://discord.com/developers/docs/topics/gateway#client-status-object */\nexport interface ClientStatus {\n /** the user's status set for an active desktop (Windows, Linux, Mac) application session */\n desktop?: string\n /** the user's status set for an active mobile (iOS, Android) application session */\n mobile?: string\n /** the user's status set for an active web (browser, bot account) application session */\n web?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure */\nexport interface Activity {\n /** the activity's name */\n name: string\n /** activity type */\n type: integer\n /** stream url, is validated when type is 1 */\n url?: string\n /** unix timestamp (in milliseconds) of when the activity was added to the user's session */\n created_at: integer\n /** unix timestamps for start and/or end of the game */\n timestamps?: ActivityTimestamps\n /** application id for the game */\n application_id?: snowflake\n /** what the player is currently doing */\n details?: string\n /** the user's current party status */\n state?: string\n /** the emoji used for a custom status */\n emoji?: Emoji\n /** information for the current party of the player */\n party?: ActivityParty\n /** images for the presence and their hover texts */\n assets?: ActivityAssets\n /** secrets for Rich Presence joining and spectating */\n secrets?: ActivitySecrets\n /** whether or not the activity is an instanced game session */\n instance?: boolean\n /** activity flags ORd together, describes what the payload includes */\n flags?: integer\n /** the custom buttons shown in the Rich Presence (max 2) */\n buttons?: ActivityButton[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps */\nexport interface ActivityTimestamps {\n /** unix time (in milliseconds) of when the activity started */\n start?: integer\n /** unix time (in milliseconds) of when the activity ends */\n end?: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji */\nexport interface ActivityEmoji {\n /** the name of the emoji */\n name: string\n /** the id of the emoji */\n id?: snowflake\n /** whether this emoji is animated */\n animated?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-party */\nexport interface ActivityParty {\n /** the id of the party */\n id?: string\n /** used to show the party's current and maximum size */\n size?: [current_size: integer, max_size: integer]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets */\nexport interface ActivityAssets {\n /** the id for a large asset of the activity, usually a snowflake */\n large_image?: string\n /** text displayed when hovering over the large image of the activity */\n large_text?: string\n /** the id for a small asset of the activity, usually a snowflake */\n small_image?: string\n /** text displayed when hovering over the small image of the activity */\n small_text?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets */\nexport interface ActivitySecrets {\n /** the id for a large asset of the activity, usually a snowflake */\n large_image?: string\n /** text displayed when hovering over the large image of the activity */\n large_text?: string\n /** the id for a small asset of the activity, usually a snowflake */\n small_image?: string\n /** text displayed when hovering over the small image of the activity */\n small_text?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-button */\nexport interface ActivityButton {\n /** the text shown on the button (1-32 characters) */\n label: string\n /** the url opened when clicking the button (1-512 characters) */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-types */\nexport enum ActivityType {\n /** Playing {name} */\n GAME = 0,\n /** Streaming {details} */\n STREAMING = 1,\n /** Listening to {name} */\n LISTENING = 2,\n /** Watching {name} */\n WATCHING = 3,\n /** {emoji} {name} */\n CUSTOM = 4,\n /** Competing in {name} */\n COMPETING = 5,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags */\nexport enum ActivityFlag {\n INSTANCE = 1 << 0,\n JOIN = 1 << 1,\n SPECTATE = 1 << 2,\n JOIN_REQUEST = 1 << 3,\n SYNC = 1 << 4,\n PLAY = 1 << 5,\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was updated */\n PRESENCE_UPDATE: PresenceUpdateEvent\n }\n}\n", "import { integer, snowflake } from '.'\n\n/** https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags */\nexport enum Permission {\n /** Allows creation of instant invites */\n CREATE_INSTANT_INVITE = 1 << 0,\n /** Allows kicking members */\n KICK_MEMBERS = 1 << 1,\n /** Allows banning members */\n BAN_MEMBERS = 1 << 2,\n /** Allows all permissions and bypasses channel permission overwrites */\n ADMINISTRATOR = 1 << 3,\n /** Allows management and editing of channels */\n MANAGE_CHANNELS = 1 << 4,\n /** Allows management and editing of the guild */\n MANAGE_GUILD = 1 << 5,\n /** Allows for the addition of reactions to messages */\n ADD_REACTIONS = 1 << 6,\n /** Allows for viewing of audit logs */\n VIEW_AUDIT_LOG = 1 << 7,\n /** Allows for using priority speaker in a voice channel */\n PRIORITY_SPEAKER = 1 << 8,\n /** Allows the user to go live */\n STREAM = 1 << 9,\n /** Allows guild members to view a channel, which includes reading messages in text channels */\n VIEW_CHANNEL = 1 << 10,\n /** Allows for sending messages in a channel (does not allow sending messages in threads) */\n SEND_MESSAGES = 1 << 11,\n /** Allows for sending of /tts messages */\n SEND_TTS_MESSAGES = 1 << 12,\n /** Allows for deletion of other users messages */\n MANAGE_MESSAGES = 1 << 13,\n /** Links sent by users with this permission will be auto-embedded */\n EMBED_LINKS = 1 << 14,\n /** Allows for uploading images and files */\n ATTACH_FILES = 1 << 15,\n /** Allows for reading of message history */\n READ_MESSAGE_HISTORY = 1 << 16,\n /** Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel */\n MENTION_EVERYONE = 1 << 17,\n /** Allows the usage of custom emojis from other servers */\n USE_EXTERNAL_EMOJIS = 1 << 18,\n /** Allows for viewing guild insights */\n VIEW_GUILD_INSIGHTS = 1 << 19,\n /** Allows for joining of a voice channel */\n CONNECT = 1 << 20,\n /** Allows for speaking in a voice channel */\n SPEAK = 1 << 21,\n /** Allows for muting members in a voice channel */\n MUTE_MEMBERS = 1 << 22,\n /** Allows for deafening of members in a voice channel */\n DEAFEN_MEMBERS = 1 << 23,\n /** Allows for moving of members between voice channels */\n MOVE_MEMBERS = 1 << 24,\n /** Allows for using voice-activity-detection in a voice channel */\n USE_VAD = 1 << 25,\n /** Allows for modification of own nickname */\n CHANGE_NICKNAME = 1 << 26,\n /** Allows for modification of other users nicknames */\n MANAGE_NICKNAMES = 1 << 27,\n /** Allows management and editing of roles */\n MANAGE_ROLES = 1 << 28,\n /** Allows management and editing of webhooks */\n MANAGE_WEBHOOKS = 1 << 29,\n /** Allows management and editing of emojis and stickers */\n MANAGE_EMOJIS_AND_STICKERS = 1 << 30,\n /** Allows members to use application commands, including slash commands and context menu commands. */\n USE_APPLICATION_COMMANDS = 1 << 31,\n /** Allows for requesting to speak in stage channels. (This permission is under active development and may be changed or removed.) */\n REQUEST_TO_SPEAK = 1 << 32,\n /** Allows for deleting and archiving threads, and viewing all private threads */\n MANAGE_THREADS = 1 << 34,\n /** Allows for creating threads */\n CREATE_PUBLIC_THREADS = 1 << 35,\n /** Allows for creating private threads */\n CREATE_PRIVATE_THREADS = 1 << 36,\n /** Allows the usage of custom stickers from other servers */\n USE_EXTERNAL_STICKERS = 1 << 37,\n /** Allows for sending messages in threads */\n SEND_MESSAGES_IN_THREADS = 1 << 38,\n /** Allows for launching activities (applications with the EMBEDDED flag) in a voice channel */\n START_EMBEDDED_ACTIVITIES = 1 << 39,\n}\n\n/** https://discord.com/developers/docs/topics/permissions#role-object-role-structure */\nexport interface Role {\n /** role id */\n id: snowflake\n /** role name */\n name: string\n /** integer representation of hexadecimal color code */\n color: integer\n /** if this role is pinned in the user listing */\n hoist: boolean\n /** role icon hash */\n icon?: string\n /** role unicode emoji */\n unicode_emoji?: string\n /** position of this role */\n position: integer\n /** permission bit set */\n permissions: string\n /** whether this role is managed by an integration */\n managed: boolean\n /** whether this role is mentionable */\n mentionable: boolean\n /** the tags this role has */\n tags?: RoleTags\n}\n\n/** https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure */\nexport interface RoleTags {\n /** the id of the bot this role belongs to */\n bot_id?: snowflake\n /** the id of the integration this role belongs to */\n integration_id?: snowflake\n /** whether this is the guild's premium subscriber role */\n premium_subscriber?: null\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-create-guild-role-create-event-fields */\nexport interface GuildRoleCreateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the role created */\n role: Role\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-update-guild-role-update-event-fields */\nexport interface GuildRoleUpdateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the role updated */\n role: Role\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-delete-guild-role-delete-event-fields */\nexport interface GuildRoleDeleteEvent {\n /** id of the guild */\n guild_id: snowflake\n /** id of the role */\n role_id: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild role was created */\n GUILD_ROLE_CREATE: GuildRoleCreateEvent\n /** guild role was updated */\n GUILD_ROLE_UPDATE: GuildRoleUpdateEvent\n /** guild role was deleted */\n GUILD_ROLE_DELETE: GuildRoleDeleteEvent\n }\n}\n", "import { integer, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure */\nexport interface StageInstance {\n /** The id of this Stage instance */\n id: snowflake\n /** The guild id of the associated Stage channel */\n guild_id: snowflake\n /** The id of the associated Stage channel */\n channel_id: snowflake\n /** The topic of the Stage instance (1-120 characters) */\n topic: string\n /** The privacy level of the Stage instance */\n privacy_level: integer\n /** Whether or not Stage Discovery is disabled */\n discoverable_disabled: boolean\n}\n\nexport interface StageInstanceCreateEvent extends StageInstance {}\n\nexport interface StageInstanceDeleteEvent extends StageInstance {}\n\nexport interface StageInstanceUpdateEvent extends StageInstance {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** stage instance was created */\n STAGE_INSTANCE_CREATE: StageInstanceCreateEvent\n /** stage instance was deleted or closed */\n STAGE_INSTANCE_DELETE: StageInstanceDeleteEvent\n /** stage instance was updated */\n STAGE_INSTANCE_UPDATE: StageInstanceUpdateEvent\n }\n}\n\nInternal.define({\n '/stage-instances': {\n POST: 'createStageInstance',\n },\n '/stage-instances/{channel.id}': {\n GET: 'getStageInstance',\n PATCH: 'modifyStageInstance',\n DELETE: 'deleteStageInstance',\n },\n})\n", "import { integer, Internal, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure */\nexport interface Sticker {\n /** id of the sticker */\n id: snowflake\n /** for standard stickers, id of the pack the sticker is from */\n pack_id?: snowflake\n /** name of the sticker */\n name: string\n /** description of the sticker */\n description?: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n /** Deprecated previously the sticker asset hash, now an empty string */\n asset: string\n /** type of sticker */\n type: integer\n /** type of sticker format */\n format_type: integer\n /** whether this guild sticker can be used, may be false due to loss of Server Boosts */\n available?: boolean\n /** id of the guild that owns this sticker */\n guild_id?: snowflake\n /** the user that uploaded the guild sticker */\n user?: User\n /** the standard sticker's sort order within its pack */\n sort_value?: integer\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types */\nexport enum StickerType {\n /** an official sticker in a pack, part of Nitro or in a removed purchasable pack */\n STANDARD = 1,\n /** a sticker uploaded to a Boosted guild for the guild's members */\n GUILD = 2,\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types */\nexport enum StickerFormatType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */\nexport interface StickerItem {\n /** id of the sticker */\n id: snowflake\n /** name of the sticker */\n name: string\n /** type of sticker format */\n format_type: integer\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure */\nexport interface StickerPack {\n /** id of the sticker pack */\n id: snowflake\n /** the stickers in the pack */\n stickers: Sticker[]\n /** name of the sticker pack */\n name: string\n /** id of the pack's SKU */\n sku_id: snowflake\n /** id of a sticker in the pack which is shown as the pack's icon */\n cover_sticker_id?: snowflake\n /** description of the sticker pack */\n description: string\n /** id of the sticker pack's banner image */\n banner_asset_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-stickers-update-guild-stickers-update-event-fields */\nexport interface GuildStickersUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** array of stickers */\n stickers: Sticker[]\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild stickers were updated */\n GUILD_STICKERS_UPDATE: GuildStickersUpdateEvent\n }\n}\n\nInternal.define({\n '/stickers/{sticker.id}': {\n GET: 'getSticker',\n },\n '/sticker-packs': {\n GET: 'listNitroStickerPacks',\n },\n '/guilds/{guild.id}/stickers': {\n GET: 'listGuildStickers',\n POST: 'createGuildSticker',\n },\n '/guilds/{guild.id}/stickers/{sticker.id}': {\n GET: 'getGuildSticker',\n PATCH: 'modifyGuildSticker',\n DELETE: 'deleteGuildSticker',\n },\n})\n", "import { snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/teams#data-models-team-object */\nexport interface Team {\n /** a hash of the image of the team's icon */\n icon?: string\n /** the unique id of the team */\n id: snowflake\n /** the members of the team */\n members: TeamMember[]\n /** the name of the team */\n name: string\n /** the user id of the current team owner */\n owner_user_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/teams#data-models-team-member-object */\nexport interface TeamMember {\n /** the user's membership state on the team */\n membership_state: MembershipState\n /** will always be [\"*\"] */\n permissions: string[]\n /** the id of the parent team of which they are a member */\n team_id: snowflake\n /** the avatar, discriminator, id, and username of the user */\n user: Partial<User>\n}\n\n/** https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum */\nexport enum MembershipState {\n INVITED = 1,\n ACCEPTED = 2,\n}\n", "import { integer, Integration, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/resources/user#user-object-user-structure */\nexport interface User {\n /** the user's id */\n id: snowflake\n /** the user's username, not unique across the platform */\n username: string\n /** the user's 4-digit discord-tag */\n discriminator: string\n /** the user's avatar hash */\n avatar?: string\n /** whether the user belongs to an OAuth2 application */\n bot?: boolean\n /** whether the user is an Official Discord System user (part of the urgent message system) */\n system?: boolean\n /** whether the user has two factor enabled on their account */\n mfa_enabled?: boolean\n /** the user's banner hash */\n banner?: string\n /** the user's banner color encoded as an integer representation of hexadecimal color code */\n accent_color?: integer\n /** the user's chosen language option */\n locale?: string\n /** whether the email on this account has been verified */\n verified?: boolean\n /** the user's email */\n email?: string\n /** the flags on a user's account */\n flags?: integer\n /** the type of Nitro subscription on a user's account */\n premium_type?: integer\n /** the public flags on a user's account */\n public_flags?: integer\n}\n\n/** https://discord.com/developers/docs/resources/user#user-object-user-flags */\nexport enum UserFlag {\n NONE = 0,\n DISCORD_EMPLOYEE = 1 << 0,\n PARTNERED_SERVER_OWNER = 1 << 1,\n HYPESQUAD_EVENTS = 1 << 2,\n BUG_HUNTER_LEVEL_1 = 1 << 3,\n HOUSE_BRAVERY = 1 << 6,\n HOUSE_BRILLIANCE = 1 << 7,\n HOUSE_BALANCE = 1 << 8,\n EARLY_SUPPORTER = 1 << 9,\n TEAM_USER = 1 << 10,\n BUG_HUNTER_LEVEL_2 = 1 << 14,\n VERIFIED_BOT = 1 << 16,\n EARLY_VERIFIED_BOT_DEVELOPER = 1 << 17,\n DISCORD_CERTIFIED_MODERATOR = 1 << 18,\n}\n\n/** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */\nexport interface Connection {\n /** id of the connection account */\n id: string\n /** the username of the connection account */\n name: string\n /** the service of the connection (twitch, youtube) */\n type: string\n /** whether the connection is revoked */\n revoked?: boolean\n /** an array of partial server integrations */\n integrations?: Partial<Integration>[]\n /** whether the connection is verified */\n verified: boolean\n /** whether friend sync is enabled for this connection */\n friend_sync: boolean\n /** whether activities related to this connection will be shown in presence updates */\n show_activity: boolean\n /** visibility of this connection */\n visibility: integer\n}\n\n/** https://discord.com/developers/docs/resources/user#connection-object-visibility-types */\nexport enum VisibilityType {\n /** invisible to everyone except the user themselves */\n NONE = 0,\n /** visible to everyone */\n EVERYONE = 1,\n}\n\nexport interface UserUpdateEvent extends User {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** properties about the user changed */\n USER_UPDATE: UserUpdateEvent\n }\n}\n\nexport interface ModifyUserOptions {\n /** user's username, if changed may cause the user's discriminator to be randomized. */\n username?: string\n /** if passed, modifies the user's avatar */\n avatar?: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/user#get-current-user */\n getCurrentUser(): Promise<User>\n /** https://discord.com/developers/docs/resources/user#get-user */\n getUser(id: snowflake): Promise<User>\n /** https://discord.com/developers/docs/resources/user#modify-current-user */\n modifyCurrentUser(options: ModifyUserOptions): Promise<User>\n /** https://discord.com/developers/docs/resources/user#get-user-connections */\n getUserConnections(): Promise<Connection[]>\n }\n}\n\nInternal.define({\n '/users/@me': {\n GET: 'getCurrentUser',\n PATCH: 'modifyCurrentUser',\n },\n '/users/{user.id}': {\n GET: 'getUser',\n },\n '/users/@me/channels': {\n POST: 'createDM',\n // POST: 'createGroupDM',\n },\n '/users/@me/connections': {\n GET: 'getUserConnections',\n },\n})\n", "import { GuildMember, Internal, snowflake, timestamp } from '.'\n\n/** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */\nexport interface VoiceState {\n /** the guild id this voice state is for */\n guild_id?: snowflake\n /** the channel id this user is connected to */\n channel_id?: snowflake\n /** the user id this voice state is for */\n user_id: snowflake\n /** the guild member this voice state is for */\n member?: GuildMember\n /** the session id for this voice state */\n session_id: string\n /** whether this user is deafened by the server */\n deaf: boolean\n /** whether this user is muted by the server */\n mute: boolean\n /** whether this user is locally deafened */\n self_deaf: boolean\n /** whether this user is locally muted */\n self_mute: boolean\n /** whether this user is streaming using \"Go Live\" */\n self_stream?: boolean\n /** whether this user's camera is enabled */\n self_video: boolean\n /** whether this user is muted by the current user */\n suppress: boolean\n /** the time at which the user requested to speak */\n request_to_speak_timestamp?: timestamp\n}\n\n/** https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure */\nexport interface VoiceRegion {\n /** unique ID for the region */\n id: string\n /** name of the region */\n name: string\n /** true for a single server that is closest to the current user's client */\n optimal: boolean\n /** whether this is a deprecated voice region (avoid switching to these) */\n deprecated: boolean\n /** whether this is a custom voice region (used for events/etc) */\n custom: boolean\n}\n\nexport interface VoiceStateUpdateEvent extends VoiceState {}\n\n/** https://discord.com/developers/docs/topics/gateway#voice-server-update-voice-server-update-event-fields */\nexport interface VoiceServerUpdateEvent {\n /** voice connection token */\n token: string\n /** the guild this voice server update is for */\n guild_id: snowflake\n /** the voice server host */\n endpoint?: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** someone joined, left, or moved a voice channel */\n VOICE_STATE_UPDATE: VoiceStateUpdateEvent\n /** guild's voice server was updated */\n VOICE_SERVER_UPDATE: VoiceServerUpdateEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/voice#list-voice-regions */\n listVoiceRegions(): Promise<VoiceRegion[]>\n }\n}\n\nInternal.define({\n '/voice/regions': {\n GET: 'listVoiceRegions',\n },\n})\n", "import { Channel, Guild, integer, Internal, Message, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */\nexport interface Webhook {\n /** the id of the webhook */\n id: snowflake\n /** the type of the webhook */\n type: integer\n /** the guild id this webhook is for, if any */\n guild_id?: snowflake\n /** the channel id this webhook is for, if any */\n channel_id?: snowflake\n /** the user this webhook was created by (not returned when getting a webhook with its token) */\n user?: User\n /** the default name of the webhook */\n name?: string\n /** the default user avatar hash of the webhook */\n avatar?: string\n /** the secure token of the webhook (returned for Incoming Webhooks) */\n token?: string\n /** the bot/OAuth2 application that created this webhook */\n application_id?: snowflake\n /** the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) */\n source_guild?: Partial<Guild>\n /** the channel that this webhook is following (returned for Channel Follower Webhooks) */\n source_channel?: Partial<Channel>\n /** the url used for executing the webhook (returned by the webhooks OAuth2 flow) */\n url?: string\n}\n\n/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */\nexport enum WebhookType {\n /** Incoming Webhooks can post messages to channels with a generated token */\n INCOMING = 1,\n /** Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels */\n CHANNEL_FOLLOWER = 2,\n /** Application webhooks are webhooks used with Interactions */\n APPLICATION = 3,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#webhooks-update-webhook-update-event-fields */\nexport interface WebhooksUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** id of the channel */\n channel_id: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild channel webhook was created, update, or deleted */\n WEBHOOKS_UPDATE: WebhooksUpdateEvent\n }\n}\n\nexport interface ModifyWebhookParams {\n /** the default name of the webhook */\n name?: string\n /** data\timage for the default webhook avatar */\n avatar?: string\n /** the new channel id this webhook should be moved to */\n channel_id?: snowflake\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */\n getChannelWebhooks(channel_id: snowflake): Promise<Webhook[]>\n /** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */\n getGuildWebhooks(guild_id: snowflake): Promise<Webhook[]>\n /** https://discord.com/developers/docs/resources/webhook#get-webhook */\n getWebhook(webhook_id: snowflake): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-with-token */\n getWebhookWithToken(webhook_id: snowflake, token: string): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook */\n modifyWebhook(webhook_id: snowflake, options: ModifyWebhookParams): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */\n modifyWebhookWithToken(webhook_id: snowflake, token: string, options: ModifyWebhookParams): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook */\n deleteWebhook(webhook_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */\n deleteWebhookWithToken(webhook_id: snowflake, token: string): Promise<void>\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook */\n /** https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook */\n /** https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook */\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-message */ \n getWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */\n deleteWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/webhooks': {\n POST: 'createWebhook',\n GET: 'getChannelWebhooks',\n },\n '/guilds/{guild.id}/webhooks': {\n GET: 'getGuildWebhooks',\n },\n '/webhooks/{webhook.id}': {\n GET: 'getWebhook',\n PATCH: 'modifyWebhook',\n DELETE: 'deleteWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}': {\n GET: 'getWebhookwithToken',\n PATCH: 'modifyWebhookwithToken',\n DELETE: 'deleteWebhookwithToken',\n POST: 'executeWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/slack': {\n POST: 'executeSlackCompatibleWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/github': {\n POST: 'executeGitHubCompatibleWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}': {\n GET: 'getWebhookMessage',\n PATCH: 'editWebhookMessage',\n DELETE: 'deleteWebhookMessage',\n },\n})\n", "import { Adapter, Context, Logger, renameProperty } from 'koishi'\nimport { GatewayOpcode, GatewayPayload, GatewayIntent } from './types'\nimport { adaptSession, adaptUser, AdapterConfig } from './utils'\nimport { BotConfig, DiscordBot } from './bot'\nimport WebSocket from 'ws'\n\nconst logger = new Logger('discord')\n\nexport default class WebSocketClient extends Adapter.WebSocketClient<BotConfig, AdapterConfig> {\n static schema = BotConfig\n\n constructor(ctx: Context, config: AdapterConfig) {\n super(ctx, config)\n this.http = ctx.http.extend({\n endpoint: 'https://discord.com/api/v8',\n ...config.request,\n })\n }\n\n prepare() {\n return new WebSocket('wss://gateway.discord.gg/?v=8&encoding=json')\n }\n\n heartbeat(bot: DiscordBot) {\n logger.debug(`heartbeat d ${bot._d}`)\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.HEARTBEAT,\n d: bot._d,\n }))\n }\n\n accept(bot: DiscordBot) {\n if (bot._sessionId) {\n logger.debug('resuming')\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.RESUME,\n d: {\n token: bot.config.token,\n session_id: bot._sessionId,\n seq: bot._d,\n },\n }))\n }\n\n bot.socket.on('message', async (data) => {\n data = data.toString()\n let parsed: GatewayPayload\n try {\n parsed = JSON.parse(data)\n } catch (error) {\n return logger.warn('cannot parse message', data)\n }\n logger.debug(require('util').inspect(parsed, false, null, true))\n if (parsed.s) {\n bot._d = parsed.s\n }\n\n // https://discord.com/developers/docs/topics/gateway#identifying\n if (parsed.op === GatewayOpcode.HELLO) {\n bot._ping = setInterval(() => this.heartbeat(bot), parsed.d.heartbeat_interval)\n if (bot._sessionId) return\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.IDENTIFY,\n d: {\n token: bot.config.token,\n properties: {},\n compress: false,\n intents: GatewayIntent.GUILD_MEMBERS\n | GatewayIntent.GUILD_MESSAGES\n | GatewayIntent.GUILD_MESSAGE_REACTIONS\n | GatewayIntent.DIRECT_MESSAGES\n | GatewayIntent.DIRECT_MESSAGE_REACTIONS,\n },\n }))\n }\n\n if (parsed.op === GatewayOpcode.DISPATCH) {\n if (parsed.t === 'READY') {\n bot._sessionId = parsed.d.session_id\n const self: any = adaptUser(parsed.d.user)\n renameProperty(self, 'selfId', 'userId')\n Object.assign(bot, self)\n logger.debug('session_id ' + bot._sessionId)\n return bot.resolve()\n }\n const session = await adaptSession(bot, parsed)\n if (session) this.dispatch(session)\n }\n })\n\n bot.socket.on('close', () => {\n clearInterval(bot._ping)\n })\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;;;ACExB,qBAA4D;;;ACD5D,oBAA4D;AAMrD,IAAM,gBAAuC,qBAAO,UAAU;AAAA,EACnE,kBAAI,OAAO;AAAA,EACX,sBAAQ,gBAAgB;AAAA;AAGnB,IAAM,YAAY,wBAAC,SAA6B;AAAA,EACrD,QAAQ,KAAK;AAAA,EACb,QAAQ,sCAAsC,KAAK,MAAM,KAAK;AAAA,EAC9D,UAAU,KAAK;AAAA,EACf,eAAe,KAAK;AAAA,EACpB,OAAO,KAAK,OAAO;AAAA,IALI;AAQlB,oBAAoB,MAA2B;AACpD,SAAO;AAAA,IACL,SAAS,KAAK;AAAA,IACd,WAAW,KAAK;AAAA;AAAA;AAHJ;AAOT,sBAAsB,MAA+B;AAC1D,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,IAChB,aAAa,KAAK;AAAA;AAAA;AAHN;AAOT,IAAM,cAAc,wBAAC,WAAiC,iCACxD,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,YAAI;AAAS,eAAK,SAAS;AAAA;AAAA;AAI/B,QAAI,OAAO,GAAG,SAAS,MAAM;AAC3B,oBAAc,IAAI;AAAA;AAAA;AAAA;AAnFxB;AACS,AADT,gBACS,SAAS;;;A7BalB,IAAO,cAAQ,uBAAQ,OAAO,WAAW,YAAY;",
4
+ "sourcesContent": ["import { Adapter } from 'koishi'\nimport { DiscordBot } from './bot'\nimport * as Discord from './types'\nimport WebSocketClient from './ws'\n\nexport { Discord }\n\nexport * from './bot'\nexport * from './sender'\nexport * from './utils'\nexport * from './ws'\n\ndeclare module 'koishi' {\n interface Modules {\n 'adapter-discord': typeof import('.')\n }\n\n interface Session {\n discord?: Discord.GatewayPayload & Discord.Internal\n }\n}\n\nexport default Adapter.define('discord', DiscordBot, WebSocketClient)\n", "/* eslint-disable camelcase */\n\nimport { Adapter, App, Bot, Schema, segment, Quester } from 'koishi'\nimport { adaptChannel, adaptGroup as adaptGuild, adaptMessage, adaptUser, AdapterConfig } from './utils'\nimport { Sender } from './sender'\nimport * as Discord from './types'\n\nexport interface BotConfig extends Bot.BaseConfig, Sender.Config {\n token: string\n}\n\nexport const BotConfig = Schema.intersect([\n Schema.object({\n token: Schema.string().description('机器人的用户令牌。').required(),\n handleExternalAsset: Schema.select({\n download: '先下载后发送',\n direct: '直接发送链接',\n auto: '发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送',\n }).description('发送外链资源时采用的方式。').default('auto'),\n handleMixedContent: Schema.select({\n separate: '将每个不同形式的内容分开发送',\n attach: '图片前如果有文本内容,则将文本作为图片的附带信息进行发送',\n auto: '如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送',\n }).description('发送图文等混合内容时采用的方式。').default('auto'),\n }),\n App.Config.Request,\n])\n\nexport class DiscordBot extends Bot<BotConfig> {\n static schema = AdapterConfig\n\n _d: number\n _ping: NodeJS.Timeout\n _sessionId: string\n\n public http: Quester\n public internal: Discord.Internal\n\n constructor(adapter: Adapter, config: BotConfig) {\n super(adapter, config)\n this._d = 0\n this._sessionId = ''\n this.http = adapter.http.extend({\n headers: { Authorization: `Bot ${config.token}`, },\n })\n this.internal = new Discord.Internal(this.http)\n }\n\n async getSelf() {\n const data = await this.internal.getCurrentUser()\n return adaptUser(data)\n }\n\n private parseQuote(chain: segment.Chain) {\n if (chain[0].type !== 'quote') return\n return chain.shift().data.id\n }\n\n async sendMessage(channelId: string, content: string, guildId?: string) {\n const session = this.createSession({ channelId, content, guildId, subtype: guildId ? 'group' : 'private' })\n if (await this.app.serial(session, 'before-send', session)) return\n\n const chain = segment.parse(session.content)\n const quote = this.parseQuote(chain)\n const message_reference = quote ? {\n message_id: quote,\n } : undefined\n\n const send = Sender.from(this, `/channels/${channelId}/messages`)\n session.messageId = await send(session.content, { message_reference })\n\n this.app.emit(session, 'send', session)\n return session.messageId\n }\n\n async sendPrivateMessage(channelId: string, content: string) {\n return this.sendMessage(channelId, content)\n }\n\n async deleteMessage(channelId: string, messageId: string) {\n await this.internal.deleteMessage(channelId, messageId)\n }\n\n async editMessage(channelId: string, messageId: string, content: string) {\n const chain = segment.parse(content)\n const image = chain.find(v => v.type === 'image')\n if (image) {\n throw new Error(\"You can't include embed object(s) while editing message.\")\n }\n await this.internal.editMessage(channelId, messageId, {\n content,\n })\n }\n\n async getMessage(channelId: string, messageId: string): Promise<Bot.Message> {\n const [msg, channel] = await Promise.all([\n this.internal.getChannelMessage(channelId, messageId),\n this.internal.getChannel(channelId),\n ])\n const result: Bot.Message = {\n messageId: msg.id,\n channelId: msg.channel_id,\n guildId: channel.guild_id,\n userId: msg.author.id,\n content: msg.content,\n timestamp: new Date(msg.timestamp).valueOf(),\n author: adaptUser(msg.author),\n }\n result.author.nickname = msg.member?.nick\n if (msg.message_reference) {\n const quoteMsg = await this.internal.getChannelMessage(msg.message_reference.channel_id, msg.message_reference.message_id)\n result.quote = adaptMessage(this, quoteMsg)\n }\n return result\n }\n\n async getUser(userId: string) {\n const data = await this.internal.getUser(userId)\n return adaptUser(data)\n }\n\n async getGuildMemberList(guildId: string) {\n const data = await this.internal.listGuildMembers(guildId)\n return data.map(v => adaptUser(v.user))\n }\n\n async getChannel(channelId: string) {\n const data = await this.internal.getChannel(channelId)\n return adaptChannel(data)\n }\n\n async getGuildMember(guildId: string, userId: string) {\n const member = await this.internal.getGuildMember(guildId, userId)\n return {\n ...adaptUser(member.user),\n nickname: member.nick,\n }\n }\n\n async getGuild(guildId: string) {\n const data = await this.internal.getGuild(guildId)\n return adaptGuild(data)\n }\n\n async getGuildList() {\n const data = await this.internal.getCurrentUserGuilds()\n return data.map(v => adaptGuild(v))\n }\n\n async getChannelList(guildId: string) {\n const data = await this.internal.getGuildChannels(guildId)\n return data.map(v => adaptChannel(v))\n }\n}\n", "/* eslint-disable camelcase */\nimport { Adapter, App, Bot, Schema, segment, Session } from 'koishi'\nimport { DiscordBot } from './bot'\nimport * as DC from './types'\n\nexport interface AdapterConfig extends Adapter.WebSocketClient.Config, App.Config.Request {}\n\nexport const AdapterConfig: Schema<AdapterConfig> = Schema.intersect([\n App.Config.Request,\n Adapter.WebSocketClient.Config,\n])\n\nexport const adaptUser = (user: DC.User): Bot.User => ({\n userId: user.id,\n avatar: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png`,\n username: user.username,\n discriminator: user.discriminator,\n isBot: user.bot || false,\n})\n\nexport function adaptGroup(data: DC.Guild): Bot.Guild {\n return {\n guildId: data.id,\n guildName: data.name,\n }\n}\n\nexport function adaptChannel(data: DC.Channel): Bot.Channel {\n return {\n channelId: data.id,\n channelName: data.name,\n }\n}\n\nexport const adaptAuthor = (author: DC.User): Bot.Author => ({\n ...adaptUser(author),\n nickname: author.username,\n})\n\nexport function adaptMessage(bot: DiscordBot, meta: DC.Message, session: Partial<Session> = {}) {\n if (meta.author) {\n session.author = adaptAuthor(meta.author)\n session.userId = meta.author.id\n }\n if (meta.member?.nick) {\n session.author.nickname = meta.member?.nick\n }\n\n // https://discord.com/developers/docs/reference#message-formatting\n session.content = ''\n if (meta.content) {\n session.content = meta.content\n .replace(/<@[!&](.+?)>/, (_, id) => {\n if (meta.mention_roles.includes(id)) {\n return segment('at', { role: id })\n } else {\n const user = meta.mentions?.find(u => u.id === id)\n return segment.at(id, { name: user?.username })\n }\n })\n .replace(/<:(.*):(.+?)>/, (_, name, id) => segment('face', { id: id, name }))\n .replace(/<a:(.*):(.+?)>/, (_, name, id) => segment('face', { id: id, name, animated: true }))\n .replace(/@everyone/, () => segment('at', { type: 'all' }))\n .replace(/@here/, () => segment('at', { type: 'here' }))\n .replace(/<#(.+?)>/, (_, id) => {\n const channel = meta.mention_channels?.find(c => c.id === id)\n return segment.sharp(id, { name: channel?.name })\n })\n }\n\n // embed 的 update event 太阴间了 只有 id embeds channel_id guild_id 四个成员\n if (meta.attachments?.length) {\n session.content += meta.attachments.map(v => {\n if (v.height && v.width && v.content_type?.startsWith('image/')) {\n return segment('image', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else if (v.height && v.width && v.content_type?.startsWith('video/')) {\n return segment('video', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else if (v.content_type?.startsWith('audio/')) {\n return segment('record', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else {\n return segment('file', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n }\n }).join('')\n }\n for (const embed of meta.embeds) {\n // not using embed types\n // https://discord.com/developers/docs/resources/channel#embed-object-embed-types\n if (embed.image) {\n session.content += segment('image', { url: embed.image.url, proxy_url: embed.image.proxy_url })\n }\n if (embed.thumbnail) {\n session.content += segment('image', { url: embed.thumbnail.url, proxy_url: embed.thumbnail.proxy_url })\n }\n if (embed.video) {\n session.content += segment('video', { url: embed.video.url, proxy_url: embed.video.proxy_url })\n }\n }\n return session as Bot.Message\n}\n\nfunction adaptMessageSession(bot: DiscordBot, meta: DC.Message, session: Partial<Session> = {}) {\n adaptMessage(bot, meta, session)\n session.messageId = meta.id\n session.timestamp = new Date(meta.timestamp).valueOf() || Date.now()\n // 遇到过 cross post 的消息在这里不会传消息 id\n if (meta.message_reference) {\n const { message_id, channel_id } = meta.message_reference\n session.content = segment('quote', { id: message_id, channelId: channel_id }) + session.content\n }\n return session\n}\n\nfunction prepareMessageSession(session: Partial<Session>, data: Partial<DC.Message>) {\n session.guildId = data.guild_id\n session.subtype = data.guild_id ? 'group' : 'private'\n session.channelId = data.channel_id\n}\n\nfunction prepareReactionSession(session: Partial<Session>, data: any) {\n session.userId = data.user_id\n session.messageId = data.message_id\n session.guildId = data.guild_id\n session.channelId = data.channel_id\n session.subtype = data.guild_id ? 'group' : 'private'\n if (!data.emoji) return\n const { id, name } = data.emoji\n session.content = id ? `${name}:${id}` : name\n}\n\nexport async function adaptSession(bot: DiscordBot, input: DC.GatewayPayload) {\n const session: Partial<Session> = {\n selfId: bot.selfId,\n }\n if (input.t === 'MESSAGE_CREATE') {\n session.type = 'message'\n prepareMessageSession(session, input.d)\n adaptMessageSession(bot, input.d, session)\n // dc 情况特殊 可能有 embeds 但是没有消息主体\n // if (!session.content) return\n if (session.userId === bot.selfId) return\n } else if (input.t === 'MESSAGE_UPDATE') {\n session.type = 'message-updated'\n prepareMessageSession(session, input.d)\n const msg = await bot.internal.getChannelMessage(input.d.channel_id, input.d.id)\n // Unlike creates, message updates may contain only a subset of the full message object payload\n // https://discord.com/developers/docs/topics/gateway#message-update\n adaptMessageSession(bot, msg, session)\n // if (!session.content) return\n if (session.userId === bot.selfId) return\n } else if (input.t === 'MESSAGE_DELETE') {\n session.type = 'message-deleted'\n session.messageId = input.d.id\n prepareMessageSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_ADD') {\n session.type = 'reaction-added'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE') {\n session.type = 'reaction-deleted'\n session.subtype = 'one'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_ALL') {\n session.type = 'reaction-deleted'\n session.subtype = 'all'\n prepareReactionSession(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_EMOJI') {\n session.type = 'reaction-deleted'\n session.subtype = 'emoji'\n prepareReactionSession(session, input.d)\n } else {\n return\n }\n return new Session(bot, session)\n}\n", "import { readFileSync } from 'fs'\nimport { basename } from 'path'\nimport { fromBuffer } from 'file-type'\nimport FormData from 'form-data'\nimport AggregateError from 'es-aggregate-error'\nimport { DiscordBot } from './bot'\nimport { segment, Dict } from 'koishi'\n\nexport type HandleExternalAsset = 'auto' | 'download' | 'direct'\nexport type HandleMixedContent = 'auto' | 'separate' | 'attach'\n\nexport namespace Sender {\n export interface Config {\n /**\n * 发送外链资源时采用的方式\n * - download:先下载后发送\n * - direct:直接发送链接\n * - auto:发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送(默认)\n */\n handleExternalAsset?: HandleExternalAsset\n /**\n * 发送图文等混合内容时采用的方式\n * - separate:将每个不同形式的内容分开发送\n * - attach:图片前如果有文本内容,则将文本作为图片的附带信息进行发送\n * - auto:如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送(默认)\n */\n handleMixedContent?: HandleMixedContent\n }\n}\n\nexport class Sender {\n private errors: Error[] = []\n\n private constructor(private bot: DiscordBot, private url: string) {}\n\n static from(bot: DiscordBot, url: string) {\n return new Sender(bot, url).sendMessage\n }\n\n async post(data?: any, headers?: any) {\n try {\n const result = await this.bot.http('POST', this.url, data, headers)\n return result.id as string\n } catch (e) {\n this.errors.push(e)\n }\n }\n\n async sendEmbed(fileBuffer: ArrayBuffer, payload_json: Dict = {}, filename: string) {\n const fd = new FormData()\n const type = await fromBuffer(fileBuffer)\n filename ||= 'file.' + type.ext\n fd.append('file', fileBuffer, filename)\n fd.append('payload_json', JSON.stringify(payload_json))\n return this.post(fd, fd.getHeaders())\n }\n\n async sendContent(content: string, addition: Dict) {\n return this.post({ ...addition, content })\n }\n\n async sendAsset(type: string, data: Dict<string>, addition: Dict) {\n const { handleMixedContent, handleExternalAsset } = this.bot.config\n\n if (handleMixedContent === 'separate' && addition.content) {\n await this.post(addition)\n addition.content = ''\n }\n\n if (data.url.startsWith('file://')) {\n const filename = basename(data.url.slice(7))\n return this.sendEmbed(readFileSync(data.url.slice(7)), addition, data.file || filename)\n } else if (data.url.startsWith('base64://')) {\n const a = Buffer.from(data.url.slice(9), 'base64')\n return await this.sendEmbed(a, addition, data.file)\n }\n\n const sendDirect = async () => {\n if (addition.content) {\n await this.post(addition)\n }\n return this.post({ ...addition, content: data.url })\n }\n\n const sendDownload = async () => {\n const filename = basename(data.url)\n const buffer = await this.bot.app.http.get.arraybuffer(data.url, {}, {\n accept: type + '/*',\n })\n return this.sendEmbed(buffer, addition, data.file || filename)\n }\n\n const mode = data.mode as HandleExternalAsset || handleExternalAsset\n if (mode === 'download' || handleMixedContent === 'attach' && addition.content || type === 'file') {\n return sendDownload()\n } else if (mode === 'direct') {\n return sendDirect()\n }\n\n // auto mode\n await this.bot.app.http.head(data.url, {}, {\n accept: type + '/*',\n }).then((headers) => {\n if (headers['content-type'].startsWith(type)) {\n return sendDirect()\n } else {\n return sendDownload()\n }\n }, sendDownload)\n }\n\n sendMessage = async (content: string, addition: Dict = {}) => {\n const chain = segment.parse(content)\n let messageId = '0'\n let textBuffer = ''\n delete addition.content\n\n const sendBuffer = async () => {\n const content = textBuffer.trim()\n if (!content) return\n messageId = await this.post({ ...addition, content })\n textBuffer = ''\n }\n\n for (const code of chain) {\n const { type, data } = code\n if (type === 'text') {\n textBuffer += data.content.trim()\n } else if (type === 'at' && data.id) {\n textBuffer += `<@${data.id}>`\n } else if (type === 'at' && data.type === 'all') {\n textBuffer += `@everyone`\n } else if (type === 'at' && data.type === 'here') {\n textBuffer += `@here`\n } else if (type === 'sharp' && data.id) {\n textBuffer += `<#${data.id}>`\n } else if (type === 'face' && data.name && data.id) {\n textBuffer += `<:${data.name}:${data.id}>`\n } else if ((type === 'image' || type === 'video') && data.url) {\n messageId = await this.sendAsset(type, data, {\n ...addition,\n content: textBuffer.trim(),\n })\n textBuffer = ''\n } else if (type === 'share') {\n await sendBuffer()\n messageId = await this.post({\n ...addition,\n embeds: [{ ...data }],\n })\n } else if (type === 'record'){\n await this.sendAsset('file', data, {\n ...addition,\n content: textBuffer.trim(),\n })\n textBuffer = ''\n }\n }\n\n await sendBuffer()\n if (!this.errors.length) return messageId\n\n throw new AggregateError(this.errors)\n }\n}\n", "export * from './internal'\n\nexport * from './application'\nexport * from './audit-log'\nexport * from './channel'\nexport * from './command'\nexport * from './component'\nexport * from './device'\nexport * from './emoji'\nexport * from './gateway'\nexport * from './guild-member'\nexport * from './guild-template'\nexport * from './guild'\nexport * from './integration'\nexport * from './interaction'\nexport * from './invite'\nexport * from './message'\nexport * from './presence'\nexport * from './role'\nexport * from './stage-instance'\nexport * from './sticker'\nexport * from './team'\nexport * from './user'\nexport * from './voice'\nexport * from './webhook'\n\nexport type integer = number\nexport type snowflake = string\nexport type timestamp = string\n", "import { Quester } from 'koishi'\n\ntype Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'\n\nexport class Internal {\n static define(routes: Record<string, Partial<Record<Method, string>>>) {\n for (const path in routes) {\n for (const method in routes[path]) {\n const name = routes[path][method]\n Internal.prototype[name] = function (this: Internal, ...args: any[]) {\n const url = path.replace(/\\{([^}]+)\\}/g, () => args.shift())\n return this.http(method as any, url)\n }\n }\n }\n }\n\n constructor(private http: Quester) {}\n}\n", "import { Guild, integer, Internal, snowflake, Team, User } from '.'\n\n/** https://discord.com/developers/docs/resources/application#application-object-application-structure */\nexport interface Application {\n /** the id of the app */\n id: snowflake\n /** the name of the app */\n name: string\n /** the icon hash of the app */\n icon?: string\n /** the description of the app */\n description: string\n /** an array of rpc origin urls, if rpc is enabled */\n rpc_origins?: string[]\n /** when false only app owner can join the app's bot to guilds */\n bot_public: boolean\n /** when true the app's bot will only join upon completion of the full oauth2 code grant flow */\n bot_require_code_grant: boolean\n /** the url of the app's terms of service */\n terms_of_service_url?: string\n /** the url of the app's privacy policy */\n privacy_policy_url?: string\n /** partial user object containing info on the owner of the application */\n owner?: Partial<User>\n /** if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */\n summary: string\n /** the hex encoded key for verification in interactions and the GameSDK's GetTicket */\n verify_key: string\n /** if the application belongs to a team, this will be a list of the members of that team */\n team?: Team\n /** if this application is a game sold on Discord, this field will be the guild to which it has been linked */\n guild_id?: snowflake\n /** if this application is a game sold on Discord, this field will be the id of the \"Game SKU\" that is created, if exists */\n primary_sku_id?: snowflake\n /** if this application is a game sold on Discord, this field will be the URL slug that links to the store page */\n slug?: string\n /** the application's default rich presence invite cover image hash */\n cover_image?: string\n /** the application's public flags */\n flags?: integer\n}\n\n/** https://discord.com/developers/docs/resources/application#application-object-application-flags */\nexport enum ApplicationFlag {\n GATEWAY_PRESENCE = 1 << 12,\n GATEWAY_PRESENCE_LIMITED = 1 << 13,\n GATEWAY_GUILD_MEMBERS = 1 << 14,\n GATEWAY_GUILD_MEMBERS_LIMITED = 1 << 15,\n VERIFICATION_PENDING_GUILD_LIMIT = 1 << 16,\n EMBEDDED = 1 << 17,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#ready-ready-event-fields */\nexport interface ReadyEvent {\n /** gateway version */\n v: integer\n /** information about the user including email */\n user: User\n /** the guilds the user is in */\n guilds: Partial<Guild>[]\n /** used for resuming connections */\n session_id: string\n /** the shard information associated with this session, if sent when identifying */\n shard?: [shard_id: integer, num_shards: integer]\n /** contains id and flags */\n application: Partial<Application>\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** contains the initial state information */\n READY: ReadyEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */\n getCurrentBotApplicationInformation(): Promise<Application>\n /** https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information */\n getCurrentAuthorizationInformation(): Promise<any>\n }\n}\n\nInternal.define({\n '/oauth2/applications/@me': {\n GET: 'getCurrentBotApplicationInformation',\n },\n '/oauth2/@me': {\n GET: 'getCurrentAuthorizationInformation',\n },\n})\n", "import { Channel, Integration, Internal, snowflake, User, Webhook } from '.'\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure */\nexport interface AuditLog {\n /** list of audit log entries */\n audit_log_entries: AuditLogEntry[]\n /** list of partial integration objects */\n integrations: Partial<Integration>[]\n /** list of threads found in the audit log* */\n threads: Channel[]\n /** list of users found in the audit log */\n users: User[]\n /** list of webhooks found in the audit log */\n webhooks: Webhook[]\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */\nexport interface AuditLogEntry {\n /** id of the affected entity (webhook, user, role, etc.) */\n target_id?: string\n /** changes made to the target_id */\n changes?: AuditLogChange[]\n /** the user who made the changes */\n user_id?: snowflake\n /** id of the entry */\n id: snowflake\n /** type of action that occurred */\n action_type: AuditLogEvent\n /** additional info for certain action types */\n options?: OptionalAuditEntryInfo\n /** the reason for the change (0-512 characters) */\n reason?: string\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events */\nexport enum AuditLogEvent {\n GUILD_UPDATE = 1,\n CHANNEL_CREATE = 10,\n CHANNEL_UPDATE = 11,\n CHANNEL_DELETE = 12,\n CHANNEL_OVERWRITE_CREATE = 13,\n CHANNEL_OVERWRITE_UPDATE = 14,\n CHANNEL_OVERWRITE_DELETE = 15,\n MEMBER_KICK = 20,\n MEMBER_PRUNE = 21,\n MEMBER_BAN_ADD = 22,\n MEMBER_BAN_REMOVE = 23,\n MEMBER_UPDATE = 24,\n MEMBER_ROLE_UPDATE = 25,\n MEMBER_MOVE = 26,\n MEMBER_DISCONNECT = 27,\n BOT_ADD = 28,\n ROLE_CREATE = 30,\n ROLE_UPDATE = 31,\n ROLE_DELETE = 32,\n INVITE_CREATE = 40,\n INVITE_UPDATE = 41,\n INVITE_DELETE = 42,\n WEBHOOK_CREATE = 50,\n WEBHOOK_UPDATE = 51,\n WEBHOOK_DELETE = 52,\n EMOJI_CREATE = 60,\n EMOJI_UPDATE = 61,\n EMOJI_DELETE = 62,\n MESSAGE_DELETE = 72,\n MESSAGE_BULK_DELETE = 73,\n MESSAGE_PIN = 74,\n MESSAGE_UNPIN = 75,\n INTEGRATION_CREATE = 80,\n INTEGRATION_UPDATE = 81,\n INTEGRATION_DELETE = 82,\n STAGE_INSTANCE_CREATE = 83,\n STAGE_INSTANCE_UPDATE = 84,\n STAGE_INSTANCE_DELETE = 85,\n STICKER_CREATE = 90,\n STICKER_UPDATE = 91,\n STICKER_DELETE = 92,\n THREAD_CREATE = 110,\n THREAD_UPDATE = 111,\n THREAD_DELETE = 112,\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */\nexport interface OptionalAuditEntryInfo {\n /** channel in which the entities were targeted */\n channel_id: snowflake\n /** number of entities that were targeted */\n count: string\n /** number of days after which inactive members were kicked */\n delete_member_days: string\n /** id of the overwritten entity */\n id: snowflake\n /** number of members removed by the prune */\n members_removed: string\n /** id of the message that was targeted */\n message_id: snowflake\n /** name of the role if type is \"0\" (not present if type is \"1\") */\n role_name: string\n /** type of overwritten entity - \"0\" for \"role\" or \"1\" for \"member\" */\n type: string\n}\n\n/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */\nexport interface AuditLogChange {\n /** new value of the key */\n new_value?: any\n /** old value of the key */\n old_value?: any\n /** name of audit log change key */\n key: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */\n getGuildAuditLog(guildId: snowflake): Promise<AuditLog>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/audit-logs': {\n GET: 'getGuildAuditLog',\n },\n})\n", "import { GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */\nexport interface Channel {\n /** the id of this channel */\n id: snowflake\n /** the type of channel */\n type: integer\n /** the id of the guild (may be missing for some channel objects received over gateway guild dispatches) */\n guild_id?: snowflake\n /** sorting position of the channel */\n position?: integer\n /** explicit permission overwrites for members and roles */\n permission_overwrites?: Overwrite[]\n /** the name of the channel (1-100 characters) */\n name?: string\n /** the channel topic (0-1024 characters) */\n topic?: string\n /** whether the channel is nsfw */\n nsfw?: boolean\n /** the id of the last message sent in this channel (may not point to an existing or valid message) */\n last_message_id?: snowflake\n /** the bitrate (in bits) of the voice channel */\n bitrate?: integer\n /** the user limit of the voice channel */\n user_limit?: integer\n /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected */\n rate_limit_per_user?: integer\n /** the recipients of the DM */\n recipients?: User[]\n /** icon hash */\n icon?: string\n /** id of the creator of the group DM or thread */\n owner_id?: snowflake\n /** application id of the group DM creator if it is bot-created */\n application_id?: snowflake\n /** for guild channels: id of the parent category for a channel (each parent category can contain up to 50 channels), for threads: id of the text channel this thread was created */\n parent_id?: snowflake\n /** when the last pinned message was pinned. This may be null in events such as GUILD_CREATE when a message is not pinned. */\n last_pin_timestamp?: timestamp\n /** voice region id for the voice channel, automatic when set to null */\n rtc_region?: string\n /** the camera video quality mode of the voice channel, 1 when not present */\n video_quality_mode?: integer\n /** an approximate count of messages in a thread, stops counting at 50 */\n message_count?: integer\n /** an approximate count of users in a thread, stops counting at 50 */\n member_count?: integer\n /** thread-specific fields not needed by other channels */\n thread_metadata?: ThreadMetadata\n /** thread member object for the current user, if they have joined the thread, only included on certain API endpoints */\n member?: ThreadMember\n /** default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */\n default_auto_archive_duration?: integer\n /** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on a slash command interaction */\n permissions?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */\nexport enum ChannelType {\n /** a text channel within a server */\n GUILD_TEXT = 0,\n /** a direct message between users */\n DM = 1,\n /** a voice channel within a server */\n GUILD_VOICE = 2,\n /** a direct message between multiple users */\n GROUP_DM = 3,\n /** an organizational category that contains up to 50 channels */\n GUILD_CATEGORY = 4,\n /** a channel that users can follow and crosspost into their own server */\n GUILD_NEWS = 5,\n /** a channel in which game developers can sell their game on Discord */\n GUILD_STORE = 6,\n /** a temporary sub-channel within a GUILD_NEWS channel */\n GUILD_NEWS_THREAD = 10,\n /** a temporary sub-channel within a GUILD_TEXT channel */\n GUILD_PUBLIC_THREAD = 11,\n /** a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission */\n GUILD_PRIVATE_THREAD = 12,\n /** a voice channel for hosting events with an audience */\n GUILD_STAGE_VOICE = 13,\n}\n\n/** https://discord.com/developers/docs/resources/channel#followed-channel-object-followed-channel-structure */\nexport interface FollowedChannel {\n /** source channel id */\n channel_id: snowflake\n /** created target webhook id */\n webhook_id: snowflake\n}\n\n/** https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure */\nexport interface Overwrite {\n /** role or user id */\n id: snowflake\n /** either 0 (role) or 1 (member) */\n type: integer\n /** permission bit set */\n allow: string\n /** permission bit set */\n deny: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure */\nexport interface ThreadMetadata {\n /** whether the thread is archived */\n archived: boolean\n /** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */\n auto_archive_duration: integer\n /** timestamp when the thread's archive status was last changed, used for calculating recent activity */\n archive_timestamp: timestamp\n /** whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it */\n locked: boolean\n /** whether non-moderators can add other non-moderators to a thread; only available on private threads */\n invitable?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#thread-member-object-thread-member-structure */\nexport interface ThreadMember {\n /** the id of the thread */\n id?: snowflake\n /** the id of the user */\n user_id?: snowflake\n /** the time the current user last joined the thread */\n join_timestamp: timestamp\n /** any user-thread settings, currently only used for notifications */\n flags: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types */\nexport enum AllowedMentionType {\n /** Controls role mentions */\n ROLE_MENTIONS = 'roles',\n /** Controls user mentions */\n USER_MENTIONS = 'users',\n /** Controls @everyone and @here mentions */\n EVERYONE_MENTIONS = 'everyone',\n}\n\n/** https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure */\nexport interface AllowedMentions {\n /** An array of allowed mention types to parse from the content. */\n parse: AllowedMentionType[]\n /** Array of role_ids to mention (Max size of 100) */\n roles: snowflake[]\n /** Array of user_ids to mention (Max size of 100) */\n users: snowflake[]\n /** For replies, whether to mention the author of the message being replied to (default false) */\n replied_user: boolean\n}\n\nexport interface ChannelCreateEvent extends Channel {}\n\nexport interface ChannelUpdateEvent extends Channel {}\n\nexport interface ChannelDeleteEvent extends Channel {}\n\n/** https://discord.com/developers/docs/topics/gateway#channel-pins-update-channel-pins-update-event-fields */\nexport interface ChannelPinsUpdateEvent {\n /** the id of the guild */\n guild_id?: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the time at which the most recent pinned message was pinned */\n last_pin_timestamp?: timestamp\n}\n\n/** https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields */\nexport interface ThreadListSyncEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the parent channel ids whose threads are being synced. If omitted, then threads were synced for the entire guild. This array may contain channel_ids that have no active threads as well, so you know to clear that data. */\n channel_ids?: snowflake[]\n /** all active threads in the given channels that the current user can access */\n threads: Channel[]\n /** all thread member objects from the synced threads for the current user, indicating which threads the current user has been added to */\n members: ThreadMember[]\n}\n\nexport interface ThreadMemberUpdateEvent extends ThreadMember {}\n\n/** https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields */\nexport interface ThreadMembersUpdateEvent {\n /** the id of the thread */\n id: snowflake\n /** the id of the guild */\n guild_id: snowflake\n /** the approximate number of members in the thread, capped at 50 */\n member_count: integer\n /** the users who were added to the thread */\n added_members?: ThreadMember[]\n /** the id of the users who were removed from the thread */\n removed_member_ids?: snowflake[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields */\nexport interface TypingStartEvent {\n /** id of the channel */\n channel_id: snowflake\n /** id of the guild */\n guild_id?: snowflake\n /** id of the user */\n user_id: snowflake\n /** unix time (in seconds) of when the user started typing */\n timestamp: integer\n /** the member who started typing if this happened in a guild */\n member?: GuildMember\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new guild channel created */\n CHANNEL_CREATE: ChannelCreateEvent\n /** channel was updated */\n CHANNEL_UPDATE: ChannelUpdateEvent\n /** channel was deleted */\n CHANNEL_DELETE: ChannelDeleteEvent\n /** message was pinned or unpinned */\n CHANNEL_PINS_UPDATE: ChannelPinsUpdateEvent\n /** sent when gaining access to a channel, contains all active threads in that channel */\n THREAD_LIST_SYNC: ThreadListSyncEvent\n /** thread member for the current user was updated */\n THREAD_MEMBER_UPDATE: ThreadMemberUpdateEvent\n /** some user(s) were added to or removed from a thread */\n THREAD_MEMBERS_UPDATE: ThreadMembersUpdateEvent\n /** user started typing in a channel */\n TYPING_START: TypingStartEvent\n }\n}\n\nexport interface ChannelPosition {\n /** channel id */\n channel_id: snowflake\n /** sorting position of the channel */\n position?: integer\n /** syncs the permission overwrites with the new parent, if moving to a new category */\n lock_permissions?: boolean\n /** the new parent ID for the channel that is moved */\n parent_id?: snowflake\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild-channels */\n getGuildChannels(guild_id: snowflake): Promise<Channel[]>\n /** https://discord.com/developers/docs/resources/guild#create-guild-channel */\n createGuildChannel(guild_id: snowflake, options: Partial<Channel>): Promise<Channel>\n /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */\n modifyGuildChannelPositions(guild_id: snowflake, positions: ChannelPosition[]): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/channels': {\n GET: 'getGuildChannels',\n POST: 'createGuildChannel',\n PATCH: 'modifyGuildChannelPositions',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#get-channel */\n getChannel(channel_id: string): Promise<Channel>\n /** https://discord.com/developers/docs/resources/channel#modify-channel */\n modifyChannel(channel_id: string, data: Partial<Channel>): Promise<Channel>\n /** https://discord.com/developers/docs/resources/channel#deleteclose-channel */\n deleteChannel(channel_id: string): Promise<Channel>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}': {\n GET: 'getChannel',\n PATCH: 'modifyChannel',\n DELETE: 'deleteChannel',\n },\n '/channels/{channel.id}/permissions/{overwrite.id}': {\n PUT: 'editChannelPermissions',\n DELETE: 'deleteChannelPermission',\n },\n '/channels/{channel.id}/invites': {\n GET: 'getChannelInvites',\n POST: 'createChannelInvite',\n },\n '/channels/{channel.id}/followers': {\n POST: 'followNewsChannel',\n },\n '/channels/{channel.id}/typing': {\n POST: 'triggerTypingIndicator',\n },\n '/channels/{channel.id}/pins': {\n GET: 'getPinnedMessages',\n },\n '/channels/{channel.id}/pins/{message.id}': {\n PUT: 'pinMessage',\n DELETE: 'unpinMessage',\n },\n '/channels/{channel.id}/recipients/{user.id}': {\n PUT: 'groupDMAddRecipient',\n DELETE: 'groupDMRemoveRecipient',\n },\n '/channels/{channel.id}/messages/{message.id}/threads': {\n POST: 'startThreadwithMessage',\n },\n '/channels/{channel.id}/threads': {\n POST: 'startThreadwithoutMessage',\n },\n '/channels/{channel.id}/thread-members/@me': {\n PUT: 'joinThread',\n DELETE: 'leaveThread',\n },\n '/channels/{channel.id}/thread-members/{user.id}': {\n PUT: 'addThreadMember',\n DELETE: 'removeThreadMember',\n GET: 'getThreadMember',\n },\n '/channels/{channel.id}/thread-members': {\n GET: 'listThreadMembers',\n },\n '/channels/{channel.id}/threads/active': {\n GET: 'listActiveThreads',\n },\n '/channels/{channel.id}/threads/archived/public': {\n GET: 'listPublicArchivedThreads',\n },\n '/channels/{channel.id}/threads/archived/private': {\n GET: 'listPrivateArchivedThreads',\n },\n '/channels/{channel.id}/users/@me/threads/archived/private': {\n GET: 'listJoinedPrivateArchivedThreads',\n },\n})\n", "import { ChannelType, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */\nexport interface ApplicationCommand {\n /** unique id of the command */\n id: snowflake\n /** the type of command, defaults 1 if not set */\n type?: ApplicationCommandType\n /** unique id of the parent application */\n application_id: snowflake\n /** guild id of the command, if not global */\n guild_id?: snowflake\n /** 1-32 character name */\n name: string\n /** 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands */\n description: string\n /** the parameters for the command, max 25 */\n options?: ApplicationCommandOption[]\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** autoincrementing version identifier updated during substantial record changes */\n version: snowflake\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */\nexport enum ApplicationCommandType {\n /** Slash commands; a text-based command that shows up when a user types / */\n CHAT_INPUT = 1,\n /** A UI-based command that shows up when you right click or tap on a user */\n USER = 2,\n /** A UI-based command that shows up when you right click or tap on a message */\n MESSAGE = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */\nexport interface ApplicationCommandOption {\n /** the type of option */\n type: ApplicationCommandOptionType\n /** 1-32 character name */\n name: string\n /** 1-100 character description */\n description: string\n /** if the parameter is required or optional--default false */\n required?: boolean\n /** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */\n choices?: ApplicationCommandOptionChoice[]\n /** if the option is a subcommand or subcommand group type, this nested options will be the parameters */\n options?: ApplicationCommandOption[]\n /** if the option is a channel type, the channels shown will be restricted to these types */\n channel_types?: ChannelType[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */\nexport enum ApplicationCommandOptionType {\n SUB_COMMAND = 1,\n SUB_COMMAND_GROUP = 2,\n STRING = 3,\n /** Any integer between -2^53 and 2^53 */\n INTEGER = 4,\n BOOLEAN = 5,\n USER = 6,\n /** Includes all channel types + categories */\n CHANNEL = 7,\n ROLE = 8,\n /** Includes users and roles */\n MENTIONABLE = 9,\n /** Any double between -2^53 and 2^53 */\n NUMBER = 10,\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */\nexport interface ApplicationCommandOptionChoice {\n /** 1-100 character choice name */\n name: string\n /** value of the choice, up to 100 characters if string */\n value: string | number\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure */\nexport interface ApplicationCommandInteractionDataOption {\n /** the name of the parameter */\n name: string\n /** value of application command option type */\n type: ApplicationCommandOptionType\n /** the value of the pair */\n value?: ApplicationCommandOptionType\n /** present if this option is a group or subcommand */\n options?: ApplicationCommandInteractionDataOption[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */\nexport interface GuildApplicationCommandPermissions {\n /** the id of the command */\n id: snowflake\n /** the id of the application the command belongs to */\n application_id: snowflake\n /** the id of the guild */\n guild_id: snowflake\n /** the permissions for the command in the guild */\n permissions: ApplicationCommandPermissions[]\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */\nexport interface ApplicationCommandPermissions {\n /** the id of the role or user */\n id: snowflake\n /** role or user */\n type: ApplicationCommandPermissionType\n /** true to allow, false, to disallow */\n permission: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */\nexport enum ApplicationCommandPermissionType {\n ROLE = 1,\n USER = 2,\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */\n getGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */\n createGlobalApplicationCommand(application_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */\n bulkOverwriteGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */\n getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */\n editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */\n deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */\n getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>\n /** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */\n createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */\n bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */\n getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<GuildApplicationCommandPermissions[]>\n /** https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions */\n batchEditApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, permissions: Partial<GuildApplicationCommandPermissions>[]): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */\n getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */\n editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, command: Partial<ApplicationCommand>): Promise<ApplicationCommand>\n /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */\n deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */\n getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<GuildApplicationCommandPermissions>\n /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */\n editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, permissions: ApplicationCommandPermissions[]): Promise<GuildApplicationCommandPermissions>\n }\n}\n\nInternal.define({\n '/applications/{application.id}/commands': {\n GET: 'getGlobalApplicationCommands',\n POST: 'createGlobalApplicationCommand',\n PUT: 'bulkOverwriteGlobalApplicationCommands',\n },\n '/applications/{application.id}/commands/{command.id}': {\n GET: 'getGlobalApplicationCommand',\n PATCH: 'editGlobalApplicationCommand',\n DELETE: 'deleteGlobalApplicationCommand',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands': {\n GET: 'getGuildApplicationCommands',\n POST: 'createGuildApplicationCommand',\n PUT: 'bulkOverwriteGuildApplicationCommands',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}': {\n GET: 'getGuildApplicationCommand',\n PATCH: 'editGuildApplicationCommand',\n DELETE: 'deleteGuildApplicationCommand',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/permissions': {\n GET: 'getGuildApplicationCommandPermissions',\n PUT: 'batchEditApplicationCommandPermissions',\n },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions': {\n GET: 'getApplicationCommandPermissions',\n PUT: 'editApplicationCommandPermissions',\n },\n})\n", "import { Emoji, integer } from '.'\n\n/** https://discord.com/developers/docs/interactions/message-components#component-object-component-structure */\nexport interface Component {\n /** component type */\n type: integer\n /** a developer-defined identifier for the component, max 100 characters */\n custom_id?: string\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** one of button styles */\n style?: integer\n /** text that appears on the button, max 80 characters */\n label?: string\n /** name, id, and animated */\n emoji?: Partial<Emoji>\n /** a url for link-style buttons */\n url?: string\n /** the choices in the select, max 25 */\n options?: SelectOption[]\n /** custom placeholder text if nothing is selected, max 100 characters */\n placeholder?: string\n /** the minimum number of items that must be chosen; default 1, min 0, max 25 */\n min_values?: integer\n /** the maximum number of items that can be chosen; default 1, max 25 */\n max_values?: integer\n /** a list of child components */\n components?: Component[]\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */\nexport enum ComponentType {\n /** A container for other components */\n ACTION_ROW = 1,\n /** A button object */\n BUTTON = 2,\n /** A select menu for picking from choices */\n SELECT_MENU = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */\nexport interface Button {\n /** 2 for a button */\n type: integer\n /** one of button styles */\n style: integer\n /** text that appears on the button, max 80 characters */\n label?: string\n /** name, id, and animated */\n emoji?: Partial<Emoji>\n /** a developer-defined identifier for the button, max 100 characters */\n custom_id?: string\n /** a url for link-style buttons */\n url?: string\n /** whether the button is disabled (default false) */\n disabled?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */\nexport interface SelectMenu {\n /** 3 for a select menu */\n type: integer\n /** a developer-defined identifier for the button, max 100 characters */\n custom_id: string\n /** the choices in the select, max 25 */\n options: SelectOption[]\n /** custom placeholder text if nothing is selected, max 100 characters */\n placeholder?: string\n /** the minimum number of items that must be chosen; default 1, min 0, max 25 */\n min_values?: integer\n /** the maximum number of items that can be chosen; default 1, max 25 */\n max_values?: integer\n /** disable the select, default false */\n disabled?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure */\nexport interface SelectOption {\n /** the user-facing name of the option, max 100 characters */\n label: string\n /** the dev-define value of the option, max 100 characters */\n value: string\n /** an additional description of the option, max 100 characters */\n description?: string\n /** id, name, and animated */\n emoji?: Partial<Emoji>\n /** will render this option as selected by default */\n default?: boolean\n}\n", "/** https://discord.com/developers/docs/topics/certified-devices#models-device-object */\nexport interface Device {\n /** the type of device */\n type: DeviceType\n /** the device's Windows UUID */\n id: string\n /** the hardware vendor */\n vendor: Vendor\n /** the model of the product */\n model: Model\n /** UUIDs of related devices */\n related: string[]\n /** if the device's native echo cancellation is enabled */\n echo_cancellation?: boolean\n /** if the device's native noise suppression is enabled */\n noise_suppression?: boolean\n /** if the device's native automatic gain control is enabled */\n automatic_gain_control?: boolean\n /** if the device is hardware muted */\n hardware_mute?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-vendor-object */\nexport interface Vendor {\n /** name of the vendor */\n name: string\n /** url for the vendor */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-model-object */\nexport interface Model {\n /** name of the model */\n name: string\n /** url for the model */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/certified-devices#models-device-type */\nexport enum DeviceType {\n AUDIO_INPUT = 'audioinput',\n AUDIO_OUTPUT = 'audiooutput',\n VIDEO_INPUT = 'videoinput',\n}\n", "import { GuildMember, integer, Internal, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */\nexport interface Emoji {\n /** emoji id */\n id?: snowflake\n /** emoji name */\n name?: string\n /** roles allowed to use this emoji */\n roles?: snowflake[]\n /** user that created this emoji */\n user?: User\n /** whether this emoji must be wrapped in colons */\n require_colons?: boolean\n /** whether this emoji is managed */\n managed?: boolean\n /** whether this emoji is animated */\n animated?: boolean\n /** whether this emoji can be used, may be false due to loss of Server Boosts */\n available?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure */\nexport interface Reaction {\n /** times this emoji has been used to react */\n count: integer\n /** whether the current user reacted using this emoji */\n me: boolean\n /** emoji information */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-emojis-update-guild-emojis-update-event-fields */\nexport interface GuildEmojisUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** array of emojis */\n emojis: Emoji[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields */\nexport interface MessageReactionAddEvent {\n /** the id of the user */\n user_id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the member who reacted if this happened in a guild */\n member?: GuildMember\n /** the emoji used to react - example */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields */\nexport interface MessageReactionRemoveEvent {\n /** the id of the user */\n user_id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the emoji used to react - example */\n emoji: Partial<Emoji>\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all-message-reaction-remove-all-event-fields */\nexport interface MessageReactionRemoveAllEvent {\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji-message-reaction-remove-emoji */\nexport interface MessageReactionRemoveEmojiEvent {\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n /** the id of the message */\n message_id: snowflake\n /** the emoji that was removed */\n emoji: Partial<Emoji>\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild emojis were updated */\n GUILD_EMOJIS_UPDATE: GuildEmojisUpdateEvent\n /** user reacted to a message */\n MESSAGE_REACTION_ADD: MessageReactionAddEvent\n /** user removed a reaction from a message */\n MESSAGE_REACTION_REMOVE: MessageReactionRemoveEvent\n /** all reactions were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_ALL: MessageReactionRemoveAllEvent\n /** all reactions for a given emoji were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_EMOJI: MessageReactionRemoveEmojiEvent\n }\n}\n\nexport interface ModifyGuildEmojiOptions {\n /** name of the emoji */\n name?: string\n /** array of snowflakes\troles allowed to use this emoji */\n roles?: snowflake[]\n}\n\nexport interface CreateGuildEmojiOptions extends ModifyGuildEmojiOptions {\n /** the 128x128 emoji image */\n image: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */\n listGuildEmojis(guild_id: snowflake): Promise<Emoji[]>\n /** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */\n getGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */\n createGuildEmoji(guild_id: snowflake, options: CreateGuildEmojiOptions): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */\n modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: ModifyGuildEmojiOptions): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */\n deleteGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/emojis': {\n GET: 'listGuildEmojis',\n POST: 'createGuildEmoji',\n },\n '/guilds/{guild.id}/emojis/{emoji.id}': {\n GET: 'getGuildEmoji',\n PATCH: 'modifyGuildEmoji',\n DELETE: 'deleteGuildEmoji',\n },\n})\n\nexport interface GetReactionsOptions {\n /** get users after this user ID */\n after?: snowflake\n /** max number of users to return (1-100) */\n limit?: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#create-reaction */\n createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-own-reaction */\n deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-user-reaction */\n deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#get-reactions */\n getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, options?: GetReactionsOptions): Promise<Reaction[]>\n /** https://discord.com/developers/docs/resources/channel#delete-all-reactions */\n deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji */\n deleteAllReactionsForEmoji(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me': {\n PUT: 'createReaction',\n DELETE: 'deleteOwnReaction',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}': {\n DELETE: 'deleteUserReaction',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions/{emoji}': {\n GET: 'getReactions',\n DELETE: 'deleteAllReactionsforEmoji',\n },\n '/channels/{channel.id}/messages/{message.id}/reactions': {\n DELETE: 'deleteAllReactions',\n },\n})\n", "import { Activity, integer, Internal, snowflake, StatusType } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway#payloads-gateway-payload-structure */\nexport interface GatewayPayloadStructure<O extends GatewayOpcode, T extends keyof GatewayEvents, D> {\n /** opcode for the payload */\n op: O\n /** event data */\n d?: D\n /** the event name for this payload */\n t?: T\n /** sequence number, used for resuming sessions and heartbeats */\n s?: number\n}\n\nexport type GatewayPayload = {\n [O in GatewayOpcode]: O extends GatewayOpcode.DISPATCH\n ? {\n [T in keyof GatewayEvents]: GatewayPayloadStructure<GatewayOpcode.DISPATCH, T, GatewayEvents[T]>\n }[keyof GatewayEvents]\n : GatewayPayloadStructure<O, never, O extends keyof GatewayParams ? GatewayParams[O] : never>\n}[GatewayOpcode]\n\n/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */\nexport enum GatewayOpcode {\n /** An event was dispatched. */\n DISPATCH = 0,\n /** Fired periodically by the client to keep the connection alive. */\n HEARTBEAT = 1,\n /** Starts a new session during the initial handshake. */\n IDENTIFY = 2,\n /** Update the client's presence. */\n PRESENCE_UPDATE = 3,\n /** Used to join/leave or move between voice channels. */\n VOICE_STATE_UPDATE = 4,\n /** Resume a previous session that was disconnected. */\n RESUME = 6,\n /** You should attempt to reconnect and resume immediately. */\n RECONNECT = 7,\n /** Request information about offline guild members in a large guild. */\n REQUEST_GUILD_MEMBERS = 8,\n /** The session has been invalidated. You should reconnect and identify/resume accordingly. */\n INVALID_SESSION = 9,\n /** Sent immediately after connecting, contains the `heartbeat_interval` to use. */\n HELLO = 10,\n /** Sent in response to receiving a heartbeat to acknowledge that it has been received. */\n HEARTBEAT_ACK = 11,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#gateway-intents */\nexport enum GatewayIntent {\n /**\n * - GUILD_CREATE\n * - GUILD_UPDATE\n * - GUILD_DELETE\n * - GUILD_ROLE_CREATE\n * - GUILD_ROLE_UPDATE\n * - GUILD_ROLE_DELETE\n * - CHANNEL_CREATE\n * - CHANNEL_UPDATE\n * - CHANNEL_DELETE\n * - CHANNEL_PINS_UPDATE\n * - THREAD_CREATE\n * - THREAD_UPDATE\n * - THREAD_DELETE\n * - THREAD_LIST_SYNC\n * - THREAD_MEMBER_UPDATE\n * - THREAD_MEMBERS_UPDATE\n * - STAGE_INSTANCE_CREATE\n * - STAGE_INSTANCE_UPDATE\n * - STAGE_INSTANCE_DELETE\n */\n GUILD_CREATE = 1 << 0,\n /**\n * - GUILD_MEMBER_ADD\n * - GUILD_MEMBER_UPDATE\n * - GUILD_MEMBER_REMOVE\n * - THREAD_MEMBERS_UPDATE\n */\n GUILD_MEMBERS = 1 << 1,\n /**\n * - GUILD_BAN_ADD\n * - GUILD_BAN_REMOVE\n */\n GUILD_BANS = 1 << 2,\n /**\n * - GUILD_EMOJIS_UPDATE\n * - GUILD_STICKERS_UPDATE\n */\n GUILD_EMOJIS_AND_STICKERS = 1 << 3,\n /**\n * - GUILD_INTEGRATIONS_UPDATE\n * - INTEGRATION_CREATE\n * - INTEGRATION_UPDATE\n * - INTEGRATION_DELETE\n */\n GUILD_INTEGRATIONS = 1 << 4,\n /**\n * - WEBHOOKS_UPDATE\n */\n GUILD_WEBHOOKS = 1 << 5,\n /**\n * - INVITE_CREATE\n * - INVITE_DELETE\n */\n GUILD_INVITES = 1 << 6,\n /**\n * - VOICE_STATE_UPDATE\n */\n GUILD_VOICE_STATES = 1 << 7,\n /**\n * - PRESENCE_UPDATE\n */\n GUILD_PRESENCES = 1 << 8,\n /**\n * - MESSAGE_CREATE\n * - MESSAGE_UPDATE\n * - MESSAGE_DELETE\n * - MESSAGE_DELETE_BULK\n */\n GUILD_MESSAGES = 1 << 9,\n /**\n * - MESSAGE_REACTION_ADD\n * - MESSAGE_REACTION_REMOVE\n * - MESSAGE_REACTION_REMOVE_ALL\n * - MESSAGE_REACTION_REMOVE_EMOJI\n */\n GUILD_MESSAGE_REACTIONS = 1 << 10,\n /**\n * - TYPING_START\n */\n GUILD_MESSAGE_TYPING = 1 << 11,\n /**\n * - MESSAGE_CREATE\n * - MESSAGE_UPDATE\n * - MESSAGE_DELETE\n * - CHANNEL_PINS_UPDATE\n */\n DIRECT_MESSAGES = 1 << 12,\n /**\n * - MESSAGE_REACTION_ADD\n * - MESSAGE_REACTION_REMOVE\n * - MESSAGE_REACTION_REMOVE_ALL\n * - MESSAGE_REACTION_REMOVE_EMOJI\n */\n DIRECT_MESSAGE_REACTIONS = 1 << 13,\n /**\n * - TYPING_START\n */\n DIRECT_MESSAGE_TYPING = 1 << 14,\n}\n\nexport interface GatewayParams {\n [GatewayOpcode.HELLO]: HelloParams\n [GatewayOpcode.IDENTIFY]: IdentifyParams\n [GatewayOpcode.RESUME]: ResumeParams\n [GatewayOpcode.REQUEST_GUILD_MEMBERS]: RequestGuildMembersParams\n [GatewayOpcode.VOICE_STATE_UPDATE]: VoiceStateUpdateParams\n [GatewayOpcode.PRESENCE_UPDATE]: PresenceUpdateParams\n}\n\n/** https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events */\nexport interface GatewayEvents {}\n\n/** https://discord.com/developers/docs/topics/gateway#identify-identify-structure */\nexport interface IdentifyParams {\n /** authentication token */\n token: string\n /** connection properties */\n properties: object\n /** whether this connection supports compression of packets */\n compress?: boolean\n /** value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list */\n large_threshold?: integer\n /** used for Guild Sharding */\n shard?: [shard_id: integer, num_shards: integer]\n /** presence structure for initial presence information */\n presence?: PresenceUpdateParams\n /** the Gateway Intents you wish to receive */\n intents: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#resume-resume-structure */\nexport interface ResumeParams {\n /** session token */\n token: string\n /** session id */\n session_id: string\n /** last sequence number received */\n seq: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#request-guild-members-guild-request-members-structure */\nexport interface RequestGuildMembersParams {\n /** id of the guild to get members for */\n guild_id: snowflake\n /** string that username starts with, or an empty string to return all members */\n query?: string\n /** maximum number of members to send matching the query; a limit of 0 can be used with an empty string query to return all members */\n limit: integer\n /** used to specify if we want the presences of the matched members */\n presences?: boolean\n /** used to specify which users you wish to fetch */\n user_ids?: snowflake | snowflake[]\n /** nonce to identify the Guild Members Chunk response */\n nonce?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-voice-state-gateway-voice-state-update-structure */\nexport interface VoiceStateUpdateParams {\n /** id of the guild */\n guild_id: snowflake\n /** id of the voice channel client wants to join (null if disconnecting) */\n channel_id?: snowflake\n /** is the client muted */\n self_mute: boolean\n /** is the client deafened */\n self_deaf: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure */\nexport interface PresenceUpdateParams {\n /** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */\n since?: integer\n /** the user's activities */\n activities: Activity[]\n /** the user's new status */\n status: StatusType\n /** whether or not the client is afk */\n afk: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#hello-hello-structure */\nexport interface HelloParams {\n /** the interval (in milliseconds) the client should heartbeat with */\n heartbeat_interval: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#session-start-limit-object-session-start-limit-structure */\nexport interface SessionStartLimit {\n /** The total number of session starts the current user is allowed */\n total: integer\n /** The remaining number of session starts the current user is allowed */\n remaining: integer\n /** The number of milliseconds after which the limit resets */\n reset_after: integer\n /** The number of identify requests allowed per 5 seconds */\n max_concurrency: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/topics/gateway#get-gateway */\n getGateway(): Promise<any>\n /** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */\n getGatewayBot(): Promise<any>\n }\n}\n\nInternal.define({\n '/gateway': {\n GET: 'getGateway',\n },\n '/gateway/bot': {\n GET: 'getGatewayBot',\n },\n})\n", "import { integer, Internal, PresenceUpdateParams, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */\nexport interface GuildMember {\n /** the user this guild member represents */\n user?: User\n /** this users guild nickname */\n nick?: string\n /** the member's guild avatar hash */\n avatar?: string\n /** array of role object ids */\n roles: snowflake[]\n /** when the user joined the guild */\n joined_at: timestamp\n /** when the user started boosting the guild */\n premium_since?: timestamp\n /** whether the user is deafened in voice channels */\n deaf: boolean\n /** whether the user is muted in voice channels */\n mute: boolean\n /** whether the user has not yet passed the guild's Membership Screening requirements */\n pending?: boolean\n /** total permissions of the member in the channel, including overwrites, returned when in the interaction object */\n permissions?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-add-guild-member-add-extra-fields */\nexport interface GuildMemberAddEvent extends GuildMember {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-remove-guild-member-remove-event-fields */\nexport interface GuildMemberRemoveEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the user who was removed */\n user: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-member-update-guild-member-update-event-fields */\nexport interface GuildMemberUpdateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** user role ids */\n roles: snowflake[]\n /** the user */\n user: User\n /** nickname of the user in the guild */\n nick?: string\n /** the member's guild avatar hash */\n avatar?: string\n /** when the user joined the guild */\n joined_at?: timestamp\n /** when the user starting boosting the guild */\n premium_since?: timestamp\n /** whether the user is deafened in voice channels */\n deaf?: boolean\n /** whether the user is muted in voice channels */\n mute?: boolean\n /** whether the user has not yet passed the guild's Membership Screening requirements */\n pending?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-members-chunk-guild-members-chunk-event-fields */\nexport interface GuildMembersChunkEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** set of guild members */\n members: GuildMember[]\n /** the chunk index in the expected chunks for this response (0 <= chunk_index < chunk_count) */\n chunk_index: integer\n /** the total number of expected chunks for this response */\n chunk_count: integer\n /** if passing an invalid id to REQUEST_GUILD_MEMBERS, it will be returned here */\n not_found?: snowflake[]\n /** if passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here */\n presences?: PresenceUpdateParams[]\n /** the nonce used in the Guild Members Request */\n nonce?: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new user joined a guild */\n GUILD_MEMBER_ADD: GuildMemberAddEvent\n /** user was removed from a guild */\n GUILD_MEMBER_REMOVE: GuildMemberRemoveEvent\n /** guild member was updated */\n GUILD_MEMBER_UPDATE: GuildMemberUpdateEvent\n /** response to Request Guild Members */\n GUILD_MEMBERS_CHUNK: GuildMembersChunkEvent\n }\n}\n\nexport interface ListGuildMembersOptions {\n /** max number of members to return (1-1000) */\n limit?: integer\n /** the highest user id in the previous page */\n after?: snowflake\n}\n\nexport interface SearchGuildMembersOptions {\n /** query string to match username(s) and nickname(s) against */\n query: string\n /** max number of members to return (1-1000) */\n limit?: integer\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild-member */\n getGuildMember(guild_id: snowflake, user_id: snowflake): Promise<GuildMember>\n /** https://discord.com/developers/docs/resources/guild#list-guild-members */\n listGuildMembers(guild_id: snowflake, options?: ListGuildMembersOptions): Promise<GuildMember[]>\n /** https://discord.com/developers/docs/resources/guild#search-guild-members */\n searchGuildMembers(guild_id: snowflake, options: SearchGuildMembersOptions): Promise<GuildMember[]>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/members/{user.id}': {\n GET: 'getGuildMember',\n PUT: 'addGuildMember',\n PATCH: 'modifyGuildMember',\n DELETE: 'removeGuildMember',\n },\n '/guilds/{guild.id}/members': {\n GET: 'listGuildMembers',\n },\n '/guilds/{guild.id}/members/search': {\n GET: 'searchGuildMembers',\n },\n '/guilds/{guild.id}/members/@me': {\n PATCH: 'modifyCurrentMember',\n },\n '/guilds/{guild.id}/members/@me/nick': {\n PATCH: 'modifyCurrentUserNick',\n },\n '/guilds/{guild.id}/members/{user.id}/roles/{role.id}': {\n PUT: 'addGuildMemberRole',\n DELETE: 'removeGuildMemberRole',\n },\n})\n", "import { Guild, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure */\nexport interface GuildTemplate {\n /** the template code (unique ID) */\n code: string\n /** template name */\n name: string\n /** the description for the template */\n description?: string\n /** number of times this template has been used */\n usage_count: integer\n /** the ID of the user who created the template */\n creator_id: snowflake\n /** the user who created the template */\n creator: User\n /** when this template was created */\n created_at: timestamp\n /** when this template was last synced to the source guild */\n updated_at: timestamp\n /** the ID of the guild this template is based on */\n source_guild_id: snowflake\n /** the guild snapshot this template contains */\n serialized_source_guild: Partial<Guild>\n /** whether the template has unsynced changes */\n is_dirty?: boolean\n}\n\nInternal.define({\n '/guilds/templates/{template.code}': {\n GET: 'getGuildTemplate',\n POST: 'createGuildfromGuildTemplate',\n },\n '/guilds/{guild.id}/templates': {\n GET: 'getGuildTemplates',\n POST: 'createGuildTemplate',\n },\n '/guilds/{guild.id}/templates/{template.code}': {\n PUT: 'syncGuildTemplate',\n PATCH: 'modifyGuildTemplate',\n DELETE: 'deleteGuildTemplate',\n },\n})\n", "import { Channel, Emoji, GuildMember, integer, Internal, PresenceUpdateEvent, Role, snowflake, StageInstance, Sticker, timestamp, User, VoiceState } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-guild-structure */\nexport interface Guild {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters, excluding trailing and leading whitespace) */\n name: string\n /** icon hash */\n icon?: string\n /** icon hash, returned when in the template object */\n icon_hash?: string\n /** splash hash */\n splash?: string\n /** discovery splash hash; only present for guilds with the \"DISCOVERABLE\" feature */\n discovery_splash?: string\n /** true if the user is the owner of the guild */\n owner?: boolean\n /** id of owner */\n owner_id: snowflake\n /** total permissions for the user in the guild (excludes overwrites) */\n permissions?: string\n /** voice region id for the guild (deprecated) */\n region?: string\n /** id of afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout: integer\n /** true if the server widget is enabled */\n widget_enabled?: boolean\n /** the channel id that the widget will generate an invite to, or null if set to no invite */\n widget_channel_id?: snowflake\n /** verification level required for the guild */\n verification_level: integer\n /** default message notifications level */\n default_message_notifications: integer\n /** explicit content filter level */\n explicit_content_filter: integer\n /** roles in the guild */\n roles: Role[]\n /** custom guild emojis */\n emojis: Emoji[]\n /** enabled guild features */\n features: GuildFeature[]\n /** required MFA level for the guild */\n mfa_level: integer\n /** application id of the guild creator if it is bot-created */\n application_id?: snowflake\n /** the id of the channel where guild notices such as welcome messages and boost events are posted */\n system_channel_id?: snowflake\n /** system channel flags */\n system_channel_flags: integer\n /** the id of the channel where Community guilds can display rules and/or guidelines */\n rules_channel_id?: snowflake\n /** when this guild was joined at */\n joined_at?: timestamp\n /** true if this is considered a large guild */\n large?: boolean\n /** true if this guild is unavailable due to an outage */\n unavailable?: boolean\n /** total number of members in this guild */\n member_count?: integer\n /** states of members currently in voice channels; lacks the guild_id key */\n voice_states?: Partial<VoiceState>[]\n /** users in the guild */\n members?: GuildMember[]\n /** channels in the guild */\n channels?: Channel[]\n /** all active threads in the guild that current user has permission to view */\n threads?: Channel[]\n /** presences of the members in the guild, will only include non-offline members if the size is greater than large threshold */\n presences?: Partial<PresenceUpdateEvent>[]\n /** the maximum number of presences for the guild (null is always returned, apart from the largest of guilds) */\n max_presences?: integer\n /** the maximum number of members for the guild */\n max_members?: integer\n /** the vanity url code for the guild */\n vanity_url_code?: string\n /** the description of a Community guild */\n description?: string\n /** banner hash */\n banner?: string\n /** premium tier (Server Boost level) */\n premium_tier: integer\n /** the number of boosts this guild currently has */\n premium_subscription_count?: integer\n /** the preferred locale of a Community guild; used in server discovery and notices from Discord; defaults to \"en-US\" */\n preferred_locale: string\n /** the id of the channel where admins and moderators of Community guilds receive notices from Discord */\n public_updates_channel_id?: snowflake\n /** the maximum amount of users in a video channel */\n max_video_channel_users?: integer\n /** approximate number of members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */\n approximate_member_count?: integer\n /** approximate number of non-offline members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true */\n approximate_presence_count?: integer\n /** the welcome screen of a Community guild, shown to new members, returned in an Invite's guild object */\n welcome_screen?: WelcomeScreen\n /** guild NSFW level */\n nsfw_level: integer\n /** Stage instances in the guild */\n stage_instances?: StageInstance[]\n /** custom guild stickers */\n stickers?: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags */\nexport enum SystemChannelFlag {\n /** Suppress member join notifications */\n SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,\n /** Suppress server boost notifications */\n SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,\n /** Suppress server setup tips */\n SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-object-guild-features */\nexport enum GuildFeature {\n /** guild has access to set an animated guild icon */\n ANIMATED_ICON = 'ANIMATED_ICON',\n /** guild has access to set a guild banner image */\n BANNER = 'BANNER',\n /** guild has access to use commerce features (i.e. create store channels) */\n COMMERCE = 'COMMERCE',\n /** guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates */\n COMMUNITY = 'COMMUNITY',\n /** guild is able to be discovered in the directory */\n DISCOVERABLE = 'DISCOVERABLE',\n /** guild is able to be featured in the directory */\n FEATURABLE = 'FEATURABLE',\n /** guild has access to set an invite splash background */\n INVITE_SPLASH = 'INVITE_SPLASH',\n /** guild has enabled Membership Screening */\n MEMBER_VERIFICATION_GATE_ENABLED = 'MEMBER_VERIFICATION_GATE_ENABLED',\n /** guild has enabled monetization */\n MONETIZATION_ENABLED = 'MONETIZATION_ENABLED',\n /** guild has increased custom sticker slots */\n MORE_STICKERS = 'MORE_STICKERS',\n /** guild has access to create news channels */\n NEWS = 'NEWS',\n /** guild is partnered */\n PARTNERED = 'PARTNERED',\n /** guild can be previewed before joining via Membership Screening or the directory */\n PREVIEW_ENABLED = 'PREVIEW_ENABLED',\n /** guild has access to create private threads */\n PRIVATE_THREADS = 'PRIVATE_THREADS',\n /** guild is able to set role icons */\n ROLE_ICONS = 'ROLE_ICONS',\n /** guild has access to the seven day archive time for threads */\n SEVEN_DAY_THREAD_ARCHIVE = 'SEVEN_DAY_THREAD_ARCHIVE',\n /** guild has access to the three day archive time for threads */\n THREE_DAY_THREAD_ARCHIVE = 'THREE_DAY_THREAD_ARCHIVE',\n /** guild has enabled ticketed events */\n TICKETED_EVENTS_ENABLED = 'TICKETED_EVENTS_ENABLED',\n /** guild has access to set a vanity URL */\n VANITY_URL = 'VANITY_URL',\n /** guild is verified */\n VERIFIED = 'VERIFIED',\n /** guild has access to set 384kbps bitrate in voice (previously VIP voice servers) */\n VIP_REGIONS = 'VIP_REGIONS',\n /** guild has enabled the welcome screen */\n WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-preview-object-guild-preview-structure */\nexport interface GuildPreview {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters) */\n name: string\n /** icon hash */\n icon?: string\n /** splash hash */\n splash?: string\n /** discovery splash hash */\n discovery_splash?: string\n /** custom guild emojis */\n emojis: Emoji[]\n /** enabled guild features */\n features: GuildFeature[]\n /** approximate number of members in this guild */\n approximate_member_count: integer\n /** approximate number of online members in this guild */\n approximate_presence_count: integer\n /** the description for the guild, if the guild is discoverable */\n description?: string\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */\nexport interface GuildWidget {\n /** whether the widget is enabled */\n enabled: boolean\n /** the widget channel id */\n channel_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/resources/guild#ban-object-ban-structure */\nexport interface Ban {\n /** the reason for the ban */\n reason?: string\n /** the banned user */\n user: User\n}\n\n/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-structure */\nexport interface WelcomeScreen {\n /** the server description shown in the welcome screen */\n description?: string\n /** the channels shown in the welcome screen, up to 5 */\n welcome_channels: WelcomeScreenChannel[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#welcome-screen-object-welcome-screen-channel-structure */\nexport interface WelcomeScreenChannel {\n /** the channel's id */\n channel_id: snowflake\n /** the description shown for the channel */\n description: string\n /** the emoji id, if the emoji is custom */\n emoji_id?: snowflake\n /** the emoji name if custom, the unicode character if standard, or null if no emoji is set */\n emoji_name?: string\n}\n\nexport interface GuildCreateEvent extends Guild {}\n\nexport interface GuildUpdateEvent extends Guild {}\n\nexport interface GuildDeleteEvent extends Guild {}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-ban-add-guild-ban-add-event-fields */\nexport interface GuildBanAddEvent {\n /** id of the guild */\n guild_id: snowflake\n /** the banned user */\n user: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-ban-remove-guild-ban-remove-event-fields */\nexport interface GuildBanRemoveEvent {\n /** id of the guild */\n guild_id: snowflake\n /** the unbanned user */\n user: User\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** lazy-load for unavailable guild, guild became available, or user joined a new guild */\n GUILD_CREATE: GuildCreateEvent\n /** guild was updated */\n GUILD_UPDATE: GuildUpdateEvent\n /** guild became unavailable, or user left/was removed from a guild */\n GUILD_DELETE: GuildDeleteEvent\n /** user was banned from a guild */\n GUILD_BAN_ADD: GuildBanAddEvent\n /** user was unbanned from a guild */\n GUILD_BAN_REMOVE: GuildBanRemoveEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/user#get-current-user-guilds */\n getCurrentUserGuilds(): Promise<Guild[]>\n /** https://discord.com/developers/docs/resources/user#leave-guild */\n leaveGuild(guild_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/users/@me/guilds': {\n GET: 'getCurrentUserGuilds',\n },\n '/users/@me/guilds/{guild.id}': {\n DELETE: 'leaveGuild',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/guild#get-guild */\n getGuild(guild_id: snowflake): Promise<Guild>\n /** https://discord.com/developers/docs/resources/guild#get-guild-preview */\n getGuildPreview(guild_id: snowflake): Promise<GuildPreview>\n /** https://discord.com/developers/docs/resources/guild#modify-guild */\n modifyGuild(guild_id: snowflake, options: Partial<Guild>): Promise<Guild>\n }\n}\n\nInternal.define({\n '/guilds': {\n POST: 'createGuild',\n },\n '/guilds/{guild.id}': {\n GET: 'getGuild',\n PATCH: 'modifyGuild',\n DELETE: 'deleteGuild',\n },\n '/guilds/{guild.id}/preview': {\n GET: 'getGuildPreview',\n },\n '/guilds/{guild.id}/threads/active': {\n GET: 'listActiveThreads',\n },\n '/guilds/{guild.id}/bans': {\n GET: 'getGuildBans',\n },\n '/guilds/{guild.id}/bans/{user.id}': {\n GET: 'getGuildBan',\n PUT: 'createGuildBan',\n DELETE: 'removeGuildBan',\n },\n '/guilds/{guild.id}/roles': {\n GET: 'getGuildRoles',\n POST: 'createGuildRole',\n PATCH: 'modifyGuildRolePositions',\n },\n '/guilds/{guild.id}/roles/{role.id}': {\n PATCH: 'modifyGuildRole',\n DELETE: 'deleteGuildRole',\n },\n '/guilds/{guild.id}/prune': {\n GET: 'getGuildPruneCount',\n POST: 'beginGuildPrune',\n },\n '/guilds/{guild.id}/regions': {\n GET: 'getGuildVoiceRegions',\n },\n '/guilds/{guild.id}/invites': {\n GET: 'getGuildInvites',\n },\n '/guilds/{guild.id}/integrations': {\n GET: 'getGuildIntegrations',\n },\n '/guilds/{guild.id}/integrations/{integration.id}': {\n DELETE: 'deleteGuildIntegration',\n },\n '/guilds/{guild.id}/widget': {\n GET: 'getGuildWidgetSettings',\n PATCH: 'modifyGuildWidget',\n },\n '/guilds/{guild.id}/widget.json': {\n GET: 'getGuildWidget',\n },\n '/guilds/{guild.id}/vanity-url': {\n GET: 'getGuildVanityURL',\n },\n '/guilds/{guild.id}/widget.png': {\n GET: 'getGuildWidgetImage',\n },\n '/guilds/{guild.id}/welcome-screen': {\n GET: 'getGuildWelcomeScreen',\n PATCH: 'modifyGuildWelcomeScreen',\n },\n '/guilds/{guild.id}/voice-states/@me': {\n PATCH: 'modifyCurrentUserVoiceState',\n },\n '/guilds/{guild.id}/voice-states/{user.id}': {\n PATCH: 'modifyUserVoiceState',\n },\n})\n", "import { integer, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild#integration-object-integration-structure */\nexport interface Integration {\n /** integration id */\n id: snowflake\n /** integration name */\n name: string\n /** integration type (twitch, youtube, or discord) */\n type: string\n /** is this integration enabled */\n enabled: boolean\n /** is this integration syncing */\n syncing?: boolean\n /** id that this integration uses for \"subscribers\" */\n role_id?: snowflake\n /** whether emoticons should be synced for this integration (twitch only currently) */\n enable_emoticons?: boolean\n /** the behavior of expiring subscribers */\n expire_behavior?: IntegrationExpireBehavior\n /** the grace period (in days) before expiring subscribers */\n expire_grace_period?: integer\n /** user for this integration */\n user?: User\n /** integration account information */\n account: IntegrationAccount\n /** when this integration was last synced */\n synced_at?: timestamp\n /** how many subscribers this integration has */\n subscriber_count?: integer\n /** has this integration been revoked */\n revoked?: boolean\n /** The bot/OAuth2 application for discord integrations */\n application?: IntegrationApplication\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors */\nexport enum IntegrationExpireBehavior {\n REMOVE_ROLE = 0,\n KICK = 1,\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-account-object-integration-account-structure */\nexport interface IntegrationAccount {\n /** id of the account */\n id: string\n /** name of the account */\n name: string\n}\n\n/** https://discord.com/developers/docs/resources/guild#integration-application-object-integration-application-structure */\nexport interface IntegrationApplication {\n /** the id of the app */\n id: snowflake\n /** the name of the app */\n name: string\n /** the icon hash of the app */\n icon?: string\n /** the description of the app */\n description: string\n /** the summary of the app */\n summary: string\n /** the bot associated with this application */\n bot?: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-integrations-update-guild-integrations-update-event-fields */\nexport interface GuildIntegrationsUpdateEvent {\n /** id of the guild whose integrations were updated */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-create-integration-create-event-additional-fields */\nexport interface IntegrationCreateEvent extends Integration {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-update-integration-update-event-additional-fields */\nexport interface IntegrationUpdateEvent extends Integration {\n /** id of the guild */\n guild_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#integration-delete-integration-delete-event-fields */\nexport interface IntegrationDeleteEvent {\n /** integration id */\n id: snowflake\n /** id of the guild */\n guild_id: snowflake\n /** id of the bot/OAuth2 application for this discord integration */\n application_id?: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild integration was updated */\n GUILD_INTEGRATIONS_UPDATE: GuildIntegrationsUpdateEvent\n /** guild integration was created */\n INTEGRATION_CREATE: IntegrationCreateEvent\n /** guild integration was updated */\n INTEGRATION_UPDATE: IntegrationUpdateEvent\n /** guild integration was deleted */\n INTEGRATION_DELETE: IntegrationDeleteEvent\n }\n}\n", "import { AllowedMentions, ApplicationCommandInteractionDataOption, Channel, Component, Embed, GuildMember, integer, Internal, Message, Role, SelectOption, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */\nexport interface Interaction {\n /** id of the interaction */\n id: snowflake\n /** id of the application this interaction is for */\n application_id: snowflake\n /** the type of interaction */\n type: InteractionType\n /** the command data payload */\n data?: InteractionData\n /** the guild it was sent from */\n guild_id?: snowflake\n /** the channel it was sent from */\n channel_id?: snowflake\n /** guild member data for the invoking user, including permissions */\n member?: GuildMember\n /** user object for the invoking user, if invoked in a DM */\n user?: User\n /** a continuation token for responding to the interaction */\n token: string\n /** read-only property, always 1 */\n version: integer\n /** for components, the message they were attached to */\n message?: Message\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type */\nexport enum InteractionType {\n PING = 1,\n APPLICATION_COMMAND = 2,\n MESSAGE_COMPONENT = 3,\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure */\nexport interface InteractionData {\n /** the ID of the invoked command */\n id: snowflake\n /** the name of the invoked command */\n name: string\n /** the type of the invoked command */\n type: integer\n /** converted users + roles + channels */\n resolved?: ResolvedData\n /** the params + values from the user */\n options?: ApplicationCommandInteractionDataOption[]\n /** the custom_id of the component */\n custom_id?: string\n /** the type of the component */\n component_type?: integer\n /** the values the user selected */\n values?: SelectOption[]\n /** id the of user or message targetted by a user or message command */\n target_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */\nexport interface ResolvedData {\n /** the ids and User objects */\n users?: Record<snowflake, User>\n /** the ids and partial Member objects */\n members?: Record<snowflake, Partial<GuildMember>>\n /** the ids and Role objects */\n roles?: Record<snowflake, Role>\n /** the ids and partial Channel objects */\n channels?: Record<snowflake, Partial<Channel>>\n /** the ids and partial Message objects */\n messages?: Record<snowflake, Partial<Message>>\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object-message-interaction-structure */\nexport interface MessageInteraction {\n /** id of the interaction */\n id: snowflake\n /** the type of interaction */\n type: InteractionType\n /** the name of the application command */\n name: string\n /** the user who invoked the interaction */\n user: User\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */\nexport interface InteractionResponse {\n /** the type of response */\n type: InteractionCallbackType\n /** an optional response message */\n data?: InteractionCallbackData\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */\nexport enum InteractionCallbackType {\n /** ACK a Ping */\n PONG = 1,\n /** respond to an interaction with a message */\n CHANNEL_MESSAGE_WITH_SOURCE = 4,\n /** ACK an interaction and edit a response later, the user sees a loading state */\n DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE = 5,\n /** for components, ACK an interaction and edit the original message later; the user does not see a loading state */\n DEFERRED_UPDATE_MESSAGE = 6,\n /** for components, edit the message the component was attached to */\n UPDATE_MESSAGE = 7,\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure */\nexport interface InteractionCallbackData {\n /** is the response TTS */\n tts?: boolean\n /** message content */\n content?: string\n /** supports up to 10 embeds */\n embeds?: Embed[]\n /** allowed mentions object */\n allowed_mentions?: AllowedMentions\n /** interaction callback data flags */\n flags?: integer\n /** message components */\n components?: Component[]\n}\n\n/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-flags */\nexport enum InteractionCallbackDataFlag {\n /** only the user receiving the message can see it */\n EPHEMERAL = 1 << 6,\n}\n\nexport interface InteractionCreateEvent extends Interaction {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user used an interaction, such as an Application Command */\n INTERACTION_CREATE: InteractionCreateEvent\n }\n}\n\nInternal.define({\n '/interactions/{interaction.id}/{interaction.token}/callback': {\n POST: 'createInteractionResponse',\n },\n '/webhooks/{application.id}/{interaction.token}/messages/@original': {\n GET: 'getOriginalInteractionResponse',\n PATCH: 'editOriginalInteractionResponse',\n DELETE: 'deleteOriginalInteractionResponse',\n },\n '/webhooks/{application.id}/{interaction.token}': {\n POST: 'createFollowupMessage',\n },\n '/webhooks/{application.id}/{interaction.token}/messages/{message.id}': {\n GET: 'getFollowupMessage',\n PATCH: 'editFollowupMessage',\n DELETE: 'deleteFollowupMessage',\n },\n})\n", "import { Application, Channel, Guild, GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/invite#invite-object-invite-structure */\nexport interface Invite {\n /** the invite code (unique ID) */\n code: string\n /** the guild this invite is for */\n guild?: Partial<Guild>\n /** the channel this invite is for */\n channel: Partial<Channel>\n /** the user who created the invite */\n inviter?: User\n /** the type of target for this voice channel invite */\n target_type?: integer\n /** the user whose stream to display for this voice channel stream invite */\n target_user?: User\n /** the embedded application to open for this voice channel embedded application invite */\n target_application?: Partial<Application>\n /** approximate count of online members, returned from the GET /invites/<code> endpoint when with_counts is true */\n approximate_presence_count?: integer\n /** approximate count of total members, returned from the GET /invites/<code> endpoint when with_counts is true */\n approximate_member_count?: integer\n /** the expiration date of this invite, returned from the GET /invites/<code> endpoint when with_expiration is true */\n expires_at?: timestamp\n /** stage instance data if there is a public Stage instance in the Stage channel this invite is for */\n stage_instance?: InviteStageInstance\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */\nexport enum InviteTargetType {\n STREAM = 1,\n EMBEDDED_APPLICATION = 2,\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure */\nexport interface InviteMetadata {\n /** number of times this invite has been used */\n uses: integer\n /** max number of times this invite can be used */\n max_uses: integer\n /** duration (in seconds) after which the invite expires */\n max_age: integer\n /** whether this invite only grants temporary membership */\n temporary: boolean\n /** when this invite was created */\n created_at: timestamp\n}\n\n/** https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure */\nexport interface InviteStageInstance {\n /** the members speaking in the Stage */\n members: Partial<GuildMember>[]\n /** the number of users in the Stage */\n participant_count: integer\n /** the number of users speaking in the Stage */\n speaker_count: integer\n /** the topic of the Stage instance (1-120 characters) */\n topic: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#invite-create-invite-create-event-fields */\nexport interface InviteCreateEvent {\n /** the channel the invite is for */\n channel_id: snowflake\n /** the unique invite code */\n code: string\n /** the time at which the invite was created */\n created_at: timestamp\n /** the guild of the invite */\n guild_id?: snowflake\n /** the user that created the invite */\n inviter?: User\n /** how long the invite is valid for (in seconds) */\n max_age: integer\n /** the maximum number of times the invite can be used */\n max_uses: integer\n /** the type of target for this voice channel invite */\n target_type?: integer\n /** the user whose stream to display for this voice channel stream invite */\n target_user?: User\n /** the embedded application to open for this voice channel embedded application invite */\n target_application?: Partial<Application>\n /** whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) */\n temporary: boolean\n /** how many times the invite has been used (always will be 0) */\n uses: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#invite-delete-invite-delete-event-fields */\nexport interface InviteDeleteEvent {\n /** the channel of the invite */\n channel_id: snowflake\n /** the guild of the invite */\n guild_id?: snowflake\n /** the unique invite code */\n code: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** invite to a channel was created */\n INVITE_CREATE: InviteCreateEvent\n /** invite to a channel was deleted */\n INVITE_DELETE: InviteDeleteEvent\n }\n}\n\nexport interface GetInviteOptions {\n /** whether to include invite metadata */\n with_counts?: boolean\n /** whether to include invite expiration date */\n with_expiration?: boolean\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/invite#get-invite */\n getInvite(code: string, options?: GetInviteOptions): Promise<Invite>\n /** https://discord.com/developers/docs/resources/invite#delete-invite */\n deleteInvite(code: string): Promise<Invite>\n }\n}\n\nInternal.define({\n '/invites/{invite.code}': {\n GET: 'getInvite',\n DELETE: 'deleteInvite',\n },\n})\n", "import { Application, Channel, ChannelType, Component, GuildMember, integer, Internal, MessageInteraction, Reaction, snowflake, Sticker, StickerItem, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-structure */\nexport interface Message {\n /** id of the message */\n id: snowflake\n /** id of the channel the message was sent in */\n channel_id: snowflake\n /** id of the guild the message was sent in */\n guild_id?: snowflake\n /** the author of this message (not guaranteed to be a valid user, see below) */\n author: User\n /** member properties for this message's author */\n member?: Partial<GuildMember>\n /** contents of the message */\n content: string\n /** when this message was sent */\n timestamp: timestamp\n /** when this message was edited (or null if never) */\n edited_timestamp?: timestamp\n /** whether this was a TTS message */\n tts: boolean\n /** whether this message mentions everyone */\n mention_everyone: boolean\n /** users specifically mentioned in the message */\n mentions: User[]\n /** roles specifically mentioned in this message */\n mention_roles: snowflake[]\n /** channels specifically mentioned in this message */\n mention_channels?: ChannelMention[]\n /** any attached files */\n attachments: Attachment[]\n /** any embedded content */\n embeds: Embed[]\n /** reactions to the message */\n reactions?: Reaction[]\n /** used for validating a message was sent */\n nonce?: integer | string\n /** whether this message is pinned */\n pinned: boolean\n /** if the message is generated by a webhook, this is the webhook's id */\n webhook_id?: snowflake\n /** type of message */\n type: integer\n /** sent with Rich Presence-related chat embeds */\n activity?: MessageActivity\n /** sent with Rich Presence-related chat embeds */\n application?: Partial<Application>\n /** if the message is a response to an Interaction, this is the id of the interaction's application */\n application_id?: snowflake\n /** data showing the source of a crosspost, channel follow add, pin, or reply message */\n message_reference?: MessageReference\n /** message flags combined as a bitfield */\n flags?: integer\n /** the message associated with the message_reference */\n referenced_message?: Message\n /** sent if the message is a response to an Interaction */\n interaction?: MessageInteraction\n /** the thread that was started from this message, includes thread member object */\n thread?: Channel\n /** sent if the message contains components like buttons, action rows, or other interactive components */\n components?: Component[]\n /** sent if the message contains stickers */\n sticker_items?: StickerItem[]\n /** Deprecated the stickers sent with the message */\n stickers?: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-types */\nexport enum MessageType {\n DEFAULT = 0,\n RECIPIENT_ADD = 1,\n RECIPIENT_REMOVE = 2,\n CALL = 3,\n CHANNEL_NAME_CHANGE = 4,\n CHANNEL_ICON_CHANGE = 5,\n CHANNEL_PINNED_MESSAGE = 6,\n GUILD_MEMBER_JOIN = 7,\n USER_PREMIUM_GUILD_SUBSCRIPTION = 8,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10,\n USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11,\n CHANNEL_FOLLOW_ADD = 12,\n GUILD_DISCOVERY_DISQUALIFIED = 14,\n GUILD_DISCOVERY_REQUALIFIED = 15,\n GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16,\n GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING = 17,\n THREAD_CREATED = 18,\n REPLY = 19,\n CHAT_INPUT_COMMAND = 20,\n THREAD_STARTER_MESSAGE = 21,\n GUILD_INVITE_REMINDER = 22,\n CONTEXT_MENU_COMMAND = 23,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */\nexport interface MessageActivity {\n /** type of message activity */\n type: integer\n /** party_id from a Rich Presence event */\n party_id?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-types */\nexport enum MessageActivityType {\n JOIN = 1,\n SPECTATE = 2,\n LISTEN = 3,\n JOIN_REQUEST = 5,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-object-message-flags */\nexport enum MessageFlag {\n /** this message has been published to subscribed channels (via Channel Following) */\n CROSSPOSTED = 1 << 0,\n /** this message originated from a message in another channel (via Channel Following) */\n IS_CROSSPOST = 1 << 1,\n /** do not include any embeds when serializing this message */\n SUPPRESS_EMBEDS = 1 << 2,\n /** the source message for this crosspost has been deleted (via Channel Following) */\n SOURCE_MESSAGE_DELETED = 1 << 3,\n /** this message came from the urgent message system */\n URGENT = 1 << 4,\n /** this message has an associated thread, with the same id as the message */\n HAS_THREAD = 1 << 5,\n /** this message is only visible to the user who invoked the Interaction */\n EPHEMERAL = 1 << 6,\n /** this message is an Interaction Response and the bot is \"thinking\" */\n LOADING = 1 << 7,\n}\n\n/** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */\nexport interface MessageReference {\n /** id of the originating message */\n message_id?: snowflake\n /** id of the originating message's channel */\n channel_id?: snowflake\n /** id of the originating message's guild */\n guild_id?: snowflake\n /** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */\n fail_if_not_exists?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-structure */\nexport interface Embed {\n /** title of embed */\n title?: string\n /** type of embed (always \"rich\" for webhook embeds) */\n type?: string\n /** description of embed */\n description?: string\n /** url of embed */\n url?: string\n /** timestamp of embed content */\n timestamp?: timestamp\n /** color code of the embed */\n color?: integer\n /** footer information */\n footer?: EmbedFooter\n /** image information */\n image?: EmbedImage\n /** thumbnail information */\n thumbnail?: EmbedThumbnail\n /** video information */\n video?: EmbedVideo\n /** provider information */\n provider?: EmbedProvider\n /** author information */\n author?: EmbedAuthor\n /** fields information */\n fields?: EmbedField[]\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */\nexport interface EmbedThumbnail {\n /** source url of thumbnail (only supports http(s) and attachments) */\n url: string\n /** a proxied url of the thumbnail */\n proxy_url?: string\n /** height of thumbnail */\n height?: integer\n /** width of thumbnail */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure */\nexport interface EmbedVideo {\n /** source url of video */\n url?: string\n /** a proxied url of the video */\n proxy_url?: string\n /** height of video */\n height?: integer\n /** width of video */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure */\nexport interface EmbedImage {\n /** source url of image (only supports http(s) and attachments) */\n url: string\n /** a proxied url of the image */\n proxy_url?: string\n /** height of image */\n height?: integer\n /** width of image */\n width?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure */\nexport interface EmbedProvider {\n /** name of provider */\n name?: string\n /** url of provider */\n url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure */\nexport interface EmbedAuthor {\n /** name of author */\n name: string\n /** url of author */\n url?: string\n /** url of author icon (only supports http(s) and attachments) */\n icon_url?: string\n /** a proxied url of author icon */\n proxy_icon_url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure */\nexport interface EmbedFooter {\n /** footer text */\n text: string\n /** url of footer icon (only supports http(s) and attachments) */\n icon_url?: string\n /** a proxied url of footer icon */\n proxy_icon_url?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure */\nexport interface EmbedField {\n /** name of the field */\n name: string\n /** value of the field */\n value: string\n /** whether or not this field should display inline */\n inline?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure */\nexport interface Attachment {\n /** attachment id */\n id: snowflake\n /** name of file attached */\n filename: string\n /** the attachment's media type */\n content_type?: string\n /** size of file in bytes */\n size: integer\n /** source url of file */\n url: string\n /** a proxied url of file */\n proxy_url: string\n /** height of file (if image) */\n height?: integer\n /** width of file (if image) */\n width?: integer\n /** whether this attachment is ephemeral */\n ephemeral?: boolean\n}\n\n/** https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure */\nexport interface ChannelMention {\n /** id of the channel */\n id: snowflake\n /** id of the guild containing the channel */\n guild_id: snowflake\n /** the type of channel */\n type: ChannelType\n /** the name of the channel */\n name: string\n}\n\nexport interface MessageCreateEvent extends Message {}\n\nexport interface MessageUpdateEvent extends Message {}\n\n/** https://discord.com/developers/docs/topics/gateway#message-delete-message-delete-event-fields */\nexport interface MessageDeleteEvent {\n /** the id of the message */\n id: snowflake\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#message-delete-bulk-message-delete-bulk-event-fields */\nexport interface MessageDeleteBulkEvent {\n /** the ids of the messages */\n ids: snowflake[]\n /** the id of the channel */\n channel_id: snowflake\n /** the id of the guild */\n guild_id?: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** message was created */\n MESSAGE_CREATE: MessageCreateEvent\n /** message was edited */\n MESSAGE_UPDATE: MessageUpdateEvent\n /** message was deleted */\n MESSAGE_DELETE: MessageDeleteEvent\n /** multiple messages were deleted at once */\n MESSAGE_DELETE_BULK: MessageDeleteBulkEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/channel#get-channel-messages */\n getChannelMessages(channel_id: snowflake): Promise<Message[]>\n /** https://discord.com/developers/docs/resources/channel#get-channel-message */\n getChannelMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#create-message */\n createMessage(channel_id: snowflake, data: Partial<Message>): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#crosspost-message */\n crosspostMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#edit-message */\n editMessage(channel_id: snowflake, message_id: snowflake, data: Partial<Message>): Promise<Message>\n /** https://discord.com/developers/docs/resources/channel#delete-message */\n deleteMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */\n bulkDeleteMessages(channel_id: snowflake, message_ids: snowflake[]): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages': {\n GET: 'getChannelMessages',\n POST: 'createMessage',\n },\n '/channels/{channel.id}/messages/{message.id}': {\n GET: 'getChannelMessage',\n PATCH: 'editMessage',\n DELETE: 'deleteMessage',\n },\n '/channels/{channel.id}/messages/{message.id}/crosspost': {\n POST: 'crosspostMessage',\n },\n '/channels/{channel.id}/messages/bulk-delete': {\n POST: 'bulkDeleteMessages',\n },\n})\n", "import { Emoji, integer, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields */\nexport interface PresenceUpdateEvent {\n /** the user presence is being updated for */\n user: User\n /** id of the guild */\n guild_id: snowflake\n /** either \"idle\", \"dnd\", \"online\", or \"offline\" */\n status: StatusType\n /** user's current activities */\n activities: Activity[]\n /** user's platform-dependent status */\n client_status: ClientStatus\n}\n\n/** https://discord.com/developers/docs/topics/gateway#update-presence-status-types */\nexport enum StatusType {\n /** Online */\n ONLINE = 'ONLINE',\n /** Do Not Disturb */\n DND = 'DND',\n /** AFK */\n IDLE = 'IDLE',\n /** Invisible and shown as offline */\n INVISIBLE = 'INVISIBLE',\n /** Offline */\n OFFLINE = 'OFFLINE',\n}\n\n/** https://discord.com/developers/docs/topics/gateway#client-status-object */\nexport interface ClientStatus {\n /** the user's status set for an active desktop (Windows, Linux, Mac) application session */\n desktop?: string\n /** the user's status set for an active mobile (iOS, Android) application session */\n mobile?: string\n /** the user's status set for an active web (browser, bot account) application session */\n web?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure */\nexport interface Activity {\n /** the activity's name */\n name: string\n /** activity type */\n type: integer\n /** stream url, is validated when type is 1 */\n url?: string\n /** unix timestamp (in milliseconds) of when the activity was added to the user's session */\n created_at: integer\n /** unix timestamps for start and/or end of the game */\n timestamps?: ActivityTimestamps\n /** application id for the game */\n application_id?: snowflake\n /** what the player is currently doing */\n details?: string\n /** the user's current party status */\n state?: string\n /** the emoji used for a custom status */\n emoji?: Emoji\n /** information for the current party of the player */\n party?: ActivityParty\n /** images for the presence and their hover texts */\n assets?: ActivityAssets\n /** secrets for Rich Presence joining and spectating */\n secrets?: ActivitySecrets\n /** whether or not the activity is an instanced game session */\n instance?: boolean\n /** activity flags ORd together, describes what the payload includes */\n flags?: integer\n /** the custom buttons shown in the Rich Presence (max 2) */\n buttons?: ActivityButton[]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps */\nexport interface ActivityTimestamps {\n /** unix time (in milliseconds) of when the activity started */\n start?: integer\n /** unix time (in milliseconds) of when the activity ends */\n end?: integer\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji */\nexport interface ActivityEmoji {\n /** the name of the emoji */\n name: string\n /** the id of the emoji */\n id?: snowflake\n /** whether this emoji is animated */\n animated?: boolean\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-party */\nexport interface ActivityParty {\n /** the id of the party */\n id?: string\n /** used to show the party's current and maximum size */\n size?: [current_size: integer, max_size: integer]\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets */\nexport interface ActivityAssets {\n /** the id for a large asset of the activity, usually a snowflake */\n large_image?: string\n /** text displayed when hovering over the large image of the activity */\n large_text?: string\n /** the id for a small asset of the activity, usually a snowflake */\n small_image?: string\n /** text displayed when hovering over the small image of the activity */\n small_text?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets */\nexport interface ActivitySecrets {\n /** the id for a large asset of the activity, usually a snowflake */\n large_image?: string\n /** text displayed when hovering over the large image of the activity */\n large_text?: string\n /** the id for a small asset of the activity, usually a snowflake */\n small_image?: string\n /** text displayed when hovering over the small image of the activity */\n small_text?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-button */\nexport interface ActivityButton {\n /** the text shown on the button (1-32 characters) */\n label: string\n /** the url opened when clicking the button (1-512 characters) */\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-types */\nexport enum ActivityType {\n /** Playing {name} */\n GAME = 0,\n /** Streaming {details} */\n STREAMING = 1,\n /** Listening to {name} */\n LISTENING = 2,\n /** Watching {name} */\n WATCHING = 3,\n /** {emoji} {name} */\n CUSTOM = 4,\n /** Competing in {name} */\n COMPETING = 5,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags */\nexport enum ActivityFlag {\n INSTANCE = 1 << 0,\n JOIN = 1 << 1,\n SPECTATE = 1 << 2,\n JOIN_REQUEST = 1 << 3,\n SYNC = 1 << 4,\n PLAY = 1 << 5,\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was updated */\n PRESENCE_UPDATE: PresenceUpdateEvent\n }\n}\n", "import { integer, snowflake } from '.'\n\n/** https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags */\nexport enum Permission {\n /** Allows creation of instant invites */\n CREATE_INSTANT_INVITE = 1 << 0,\n /** Allows kicking members */\n KICK_MEMBERS = 1 << 1,\n /** Allows banning members */\n BAN_MEMBERS = 1 << 2,\n /** Allows all permissions and bypasses channel permission overwrites */\n ADMINISTRATOR = 1 << 3,\n /** Allows management and editing of channels */\n MANAGE_CHANNELS = 1 << 4,\n /** Allows management and editing of the guild */\n MANAGE_GUILD = 1 << 5,\n /** Allows for the addition of reactions to messages */\n ADD_REACTIONS = 1 << 6,\n /** Allows for viewing of audit logs */\n VIEW_AUDIT_LOG = 1 << 7,\n /** Allows for using priority speaker in a voice channel */\n PRIORITY_SPEAKER = 1 << 8,\n /** Allows the user to go live */\n STREAM = 1 << 9,\n /** Allows guild members to view a channel, which includes reading messages in text channels */\n VIEW_CHANNEL = 1 << 10,\n /** Allows for sending messages in a channel (does not allow sending messages in threads) */\n SEND_MESSAGES = 1 << 11,\n /** Allows for sending of /tts messages */\n SEND_TTS_MESSAGES = 1 << 12,\n /** Allows for deletion of other users messages */\n MANAGE_MESSAGES = 1 << 13,\n /** Links sent by users with this permission will be auto-embedded */\n EMBED_LINKS = 1 << 14,\n /** Allows for uploading images and files */\n ATTACH_FILES = 1 << 15,\n /** Allows for reading of message history */\n READ_MESSAGE_HISTORY = 1 << 16,\n /** Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel */\n MENTION_EVERYONE = 1 << 17,\n /** Allows the usage of custom emojis from other servers */\n USE_EXTERNAL_EMOJIS = 1 << 18,\n /** Allows for viewing guild insights */\n VIEW_GUILD_INSIGHTS = 1 << 19,\n /** Allows for joining of a voice channel */\n CONNECT = 1 << 20,\n /** Allows for speaking in a voice channel */\n SPEAK = 1 << 21,\n /** Allows for muting members in a voice channel */\n MUTE_MEMBERS = 1 << 22,\n /** Allows for deafening of members in a voice channel */\n DEAFEN_MEMBERS = 1 << 23,\n /** Allows for moving of members between voice channels */\n MOVE_MEMBERS = 1 << 24,\n /** Allows for using voice-activity-detection in a voice channel */\n USE_VAD = 1 << 25,\n /** Allows for modification of own nickname */\n CHANGE_NICKNAME = 1 << 26,\n /** Allows for modification of other users nicknames */\n MANAGE_NICKNAMES = 1 << 27,\n /** Allows management and editing of roles */\n MANAGE_ROLES = 1 << 28,\n /** Allows management and editing of webhooks */\n MANAGE_WEBHOOKS = 1 << 29,\n /** Allows management and editing of emojis and stickers */\n MANAGE_EMOJIS_AND_STICKERS = 1 << 30,\n /** Allows members to use application commands, including slash commands and context menu commands. */\n USE_APPLICATION_COMMANDS = 1 << 31,\n /** Allows for requesting to speak in stage channels. (This permission is under active development and may be changed or removed.) */\n REQUEST_TO_SPEAK = 1 << 32,\n /** Allows for deleting and archiving threads, and viewing all private threads */\n MANAGE_THREADS = 1 << 34,\n /** Allows for creating threads */\n CREATE_PUBLIC_THREADS = 1 << 35,\n /** Allows for creating private threads */\n CREATE_PRIVATE_THREADS = 1 << 36,\n /** Allows the usage of custom stickers from other servers */\n USE_EXTERNAL_STICKERS = 1 << 37,\n /** Allows for sending messages in threads */\n SEND_MESSAGES_IN_THREADS = 1 << 38,\n /** Allows for launching activities (applications with the EMBEDDED flag) in a voice channel */\n START_EMBEDDED_ACTIVITIES = 1 << 39,\n}\n\n/** https://discord.com/developers/docs/topics/permissions#role-object-role-structure */\nexport interface Role {\n /** role id */\n id: snowflake\n /** role name */\n name: string\n /** integer representation of hexadecimal color code */\n color: integer\n /** if this role is pinned in the user listing */\n hoist: boolean\n /** role icon hash */\n icon?: string\n /** role unicode emoji */\n unicode_emoji?: string\n /** position of this role */\n position: integer\n /** permission bit set */\n permissions: string\n /** whether this role is managed by an integration */\n managed: boolean\n /** whether this role is mentionable */\n mentionable: boolean\n /** the tags this role has */\n tags?: RoleTags\n}\n\n/** https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure */\nexport interface RoleTags {\n /** the id of the bot this role belongs to */\n bot_id?: snowflake\n /** the id of the integration this role belongs to */\n integration_id?: snowflake\n /** whether this is the guild's premium subscriber role */\n premium_subscriber?: null\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-create-guild-role-create-event-fields */\nexport interface GuildRoleCreateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the role created */\n role: Role\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-update-guild-role-update-event-fields */\nexport interface GuildRoleUpdateEvent {\n /** the id of the guild */\n guild_id: snowflake\n /** the role updated */\n role: Role\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-role-delete-guild-role-delete-event-fields */\nexport interface GuildRoleDeleteEvent {\n /** id of the guild */\n guild_id: snowflake\n /** id of the role */\n role_id: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild role was created */\n GUILD_ROLE_CREATE: GuildRoleCreateEvent\n /** guild role was updated */\n GUILD_ROLE_UPDATE: GuildRoleUpdateEvent\n /** guild role was deleted */\n GUILD_ROLE_DELETE: GuildRoleDeleteEvent\n }\n}\n", "import { integer, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure */\nexport interface StageInstance {\n /** The id of this Stage instance */\n id: snowflake\n /** The guild id of the associated Stage channel */\n guild_id: snowflake\n /** The id of the associated Stage channel */\n channel_id: snowflake\n /** The topic of the Stage instance (1-120 characters) */\n topic: string\n /** The privacy level of the Stage instance */\n privacy_level: integer\n /** Whether or not Stage Discovery is disabled */\n discoverable_disabled: boolean\n}\n\nexport interface StageInstanceCreateEvent extends StageInstance {}\n\nexport interface StageInstanceDeleteEvent extends StageInstance {}\n\nexport interface StageInstanceUpdateEvent extends StageInstance {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** stage instance was created */\n STAGE_INSTANCE_CREATE: StageInstanceCreateEvent\n /** stage instance was deleted or closed */\n STAGE_INSTANCE_DELETE: StageInstanceDeleteEvent\n /** stage instance was updated */\n STAGE_INSTANCE_UPDATE: StageInstanceUpdateEvent\n }\n}\n\nInternal.define({\n '/stage-instances': {\n POST: 'createStageInstance',\n },\n '/stage-instances/{channel.id}': {\n GET: 'getStageInstance',\n PATCH: 'modifyStageInstance',\n DELETE: 'deleteStageInstance',\n },\n})\n", "import { integer, Internal, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-structure */\nexport interface Sticker {\n /** id of the sticker */\n id: snowflake\n /** for standard stickers, id of the pack the sticker is from */\n pack_id?: snowflake\n /** name of the sticker */\n name: string\n /** description of the sticker */\n description?: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n /** Deprecated previously the sticker asset hash, now an empty string */\n asset: string\n /** type of sticker */\n type: integer\n /** type of sticker format */\n format_type: integer\n /** whether this guild sticker can be used, may be false due to loss of Server Boosts */\n available?: boolean\n /** id of the guild that owns this sticker */\n guild_id?: snowflake\n /** the user that uploaded the guild sticker */\n user?: User\n /** the standard sticker's sort order within its pack */\n sort_value?: integer\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types */\nexport enum StickerType {\n /** an official sticker in a pack, part of Nitro or in a removed purchasable pack */\n STANDARD = 1,\n /** a sticker uploaded to a Boosted guild for the guild's members */\n GUILD = 2,\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types */\nexport enum StickerFormatType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */\nexport interface StickerItem {\n /** id of the sticker */\n id: snowflake\n /** name of the sticker */\n name: string\n /** type of sticker format */\n format_type: integer\n}\n\n/** https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure */\nexport interface StickerPack {\n /** id of the sticker pack */\n id: snowflake\n /** the stickers in the pack */\n stickers: Sticker[]\n /** name of the sticker pack */\n name: string\n /** id of the pack's SKU */\n sku_id: snowflake\n /** id of a sticker in the pack which is shown as the pack's icon */\n cover_sticker_id?: snowflake\n /** description of the sticker pack */\n description: string\n /** id of the sticker pack's banner image */\n banner_asset_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/gateway#guild-stickers-update-guild-stickers-update-event-fields */\nexport interface GuildStickersUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** array of stickers */\n stickers: Sticker[]\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild stickers were updated */\n GUILD_STICKERS_UPDATE: GuildStickersUpdateEvent\n }\n}\n\nInternal.define({\n '/stickers/{sticker.id}': {\n GET: 'getSticker',\n },\n '/sticker-packs': {\n GET: 'listNitroStickerPacks',\n },\n '/guilds/{guild.id}/stickers': {\n GET: 'listGuildStickers',\n POST: 'createGuildSticker',\n },\n '/guilds/{guild.id}/stickers/{sticker.id}': {\n GET: 'getGuildSticker',\n PATCH: 'modifyGuildSticker',\n DELETE: 'deleteGuildSticker',\n },\n})\n", "import { snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/teams#data-models-team-object */\nexport interface Team {\n /** a hash of the image of the team's icon */\n icon?: string\n /** the unique id of the team */\n id: snowflake\n /** the members of the team */\n members: TeamMember[]\n /** the name of the team */\n name: string\n /** the user id of the current team owner */\n owner_user_id: snowflake\n}\n\n/** https://discord.com/developers/docs/topics/teams#data-models-team-member-object */\nexport interface TeamMember {\n /** the user's membership state on the team */\n membership_state: MembershipState\n /** will always be [\"*\"] */\n permissions: string[]\n /** the id of the parent team of which they are a member */\n team_id: snowflake\n /** the avatar, discriminator, id, and username of the user */\n user: Partial<User>\n}\n\n/** https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum */\nexport enum MembershipState {\n INVITED = 1,\n ACCEPTED = 2,\n}\n", "import { integer, Integration, Internal, snowflake } from '.'\n\n/** https://discord.com/developers/docs/resources/user#user-object-user-structure */\nexport interface User {\n /** the user's id */\n id: snowflake\n /** the user's username, not unique across the platform */\n username: string\n /** the user's 4-digit discord-tag */\n discriminator: string\n /** the user's avatar hash */\n avatar?: string\n /** whether the user belongs to an OAuth2 application */\n bot?: boolean\n /** whether the user is an Official Discord System user (part of the urgent message system) */\n system?: boolean\n /** whether the user has two factor enabled on their account */\n mfa_enabled?: boolean\n /** the user's banner hash */\n banner?: string\n /** the user's banner color encoded as an integer representation of hexadecimal color code */\n accent_color?: integer\n /** the user's chosen language option */\n locale?: string\n /** whether the email on this account has been verified */\n verified?: boolean\n /** the user's email */\n email?: string\n /** the flags on a user's account */\n flags?: integer\n /** the type of Nitro subscription on a user's account */\n premium_type?: integer\n /** the public flags on a user's account */\n public_flags?: integer\n}\n\n/** https://discord.com/developers/docs/resources/user#user-object-user-flags */\nexport enum UserFlag {\n NONE = 0,\n DISCORD_EMPLOYEE = 1 << 0,\n PARTNERED_SERVER_OWNER = 1 << 1,\n HYPESQUAD_EVENTS = 1 << 2,\n BUG_HUNTER_LEVEL_1 = 1 << 3,\n HOUSE_BRAVERY = 1 << 6,\n HOUSE_BRILLIANCE = 1 << 7,\n HOUSE_BALANCE = 1 << 8,\n EARLY_SUPPORTER = 1 << 9,\n TEAM_USER = 1 << 10,\n BUG_HUNTER_LEVEL_2 = 1 << 14,\n VERIFIED_BOT = 1 << 16,\n EARLY_VERIFIED_BOT_DEVELOPER = 1 << 17,\n DISCORD_CERTIFIED_MODERATOR = 1 << 18,\n}\n\n/** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */\nexport interface Connection {\n /** id of the connection account */\n id: string\n /** the username of the connection account */\n name: string\n /** the service of the connection (twitch, youtube) */\n type: string\n /** whether the connection is revoked */\n revoked?: boolean\n /** an array of partial server integrations */\n integrations?: Partial<Integration>[]\n /** whether the connection is verified */\n verified: boolean\n /** whether friend sync is enabled for this connection */\n friend_sync: boolean\n /** whether activities related to this connection will be shown in presence updates */\n show_activity: boolean\n /** visibility of this connection */\n visibility: integer\n}\n\n/** https://discord.com/developers/docs/resources/user#connection-object-visibility-types */\nexport enum VisibilityType {\n /** invisible to everyone except the user themselves */\n NONE = 0,\n /** visible to everyone */\n EVERYONE = 1,\n}\n\nexport interface UserUpdateEvent extends User {}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** properties about the user changed */\n USER_UPDATE: UserUpdateEvent\n }\n}\n\nexport interface ModifyUserOptions {\n /** user's username, if changed may cause the user's discriminator to be randomized. */\n username?: string\n /** if passed, modifies the user's avatar */\n avatar?: string\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/user#get-current-user */\n getCurrentUser(): Promise<User>\n /** https://discord.com/developers/docs/resources/user#get-user */\n getUser(id: snowflake): Promise<User>\n /** https://discord.com/developers/docs/resources/user#modify-current-user */\n modifyCurrentUser(options: ModifyUserOptions): Promise<User>\n /** https://discord.com/developers/docs/resources/user#get-user-connections */\n getUserConnections(): Promise<Connection[]>\n }\n}\n\nInternal.define({\n '/users/@me': {\n GET: 'getCurrentUser',\n PATCH: 'modifyCurrentUser',\n },\n '/users/{user.id}': {\n GET: 'getUser',\n },\n '/users/@me/channels': {\n POST: 'createDM',\n // POST: 'createGroupDM',\n },\n '/users/@me/connections': {\n GET: 'getUserConnections',\n },\n})\n", "import { GuildMember, Internal, snowflake, timestamp } from '.'\n\n/** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */\nexport interface VoiceState {\n /** the guild id this voice state is for */\n guild_id?: snowflake\n /** the channel id this user is connected to */\n channel_id?: snowflake\n /** the user id this voice state is for */\n user_id: snowflake\n /** the guild member this voice state is for */\n member?: GuildMember\n /** the session id for this voice state */\n session_id: string\n /** whether this user is deafened by the server */\n deaf: boolean\n /** whether this user is muted by the server */\n mute: boolean\n /** whether this user is locally deafened */\n self_deaf: boolean\n /** whether this user is locally muted */\n self_mute: boolean\n /** whether this user is streaming using \"Go Live\" */\n self_stream?: boolean\n /** whether this user's camera is enabled */\n self_video: boolean\n /** whether this user is muted by the current user */\n suppress: boolean\n /** the time at which the user requested to speak */\n request_to_speak_timestamp?: timestamp\n}\n\n/** https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure */\nexport interface VoiceRegion {\n /** unique ID for the region */\n id: string\n /** name of the region */\n name: string\n /** true for a single server that is closest to the current user's client */\n optimal: boolean\n /** whether this is a deprecated voice region (avoid switching to these) */\n deprecated: boolean\n /** whether this is a custom voice region (used for events/etc) */\n custom: boolean\n}\n\nexport interface VoiceStateUpdateEvent extends VoiceState {}\n\n/** https://discord.com/developers/docs/topics/gateway#voice-server-update-voice-server-update-event-fields */\nexport interface VoiceServerUpdateEvent {\n /** voice connection token */\n token: string\n /** the guild this voice server update is for */\n guild_id: snowflake\n /** the voice server host */\n endpoint?: string\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** someone joined, left, or moved a voice channel */\n VOICE_STATE_UPDATE: VoiceStateUpdateEvent\n /** guild's voice server was updated */\n VOICE_SERVER_UPDATE: VoiceServerUpdateEvent\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/voice#list-voice-regions */\n listVoiceRegions(): Promise<VoiceRegion[]>\n }\n}\n\nInternal.define({\n '/voice/regions': {\n GET: 'listVoiceRegions',\n },\n})\n", "import { Channel, Guild, integer, Internal, Message, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */\nexport interface Webhook {\n /** the id of the webhook */\n id: snowflake\n /** the type of the webhook */\n type: integer\n /** the guild id this webhook is for, if any */\n guild_id?: snowflake\n /** the channel id this webhook is for, if any */\n channel_id?: snowflake\n /** the user this webhook was created by (not returned when getting a webhook with its token) */\n user?: User\n /** the default name of the webhook */\n name?: string\n /** the default user avatar hash of the webhook */\n avatar?: string\n /** the secure token of the webhook (returned for Incoming Webhooks) */\n token?: string\n /** the bot/OAuth2 application that created this webhook */\n application_id?: snowflake\n /** the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) */\n source_guild?: Partial<Guild>\n /** the channel that this webhook is following (returned for Channel Follower Webhooks) */\n source_channel?: Partial<Channel>\n /** the url used for executing the webhook (returned by the webhooks OAuth2 flow) */\n url?: string\n}\n\n/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */\nexport enum WebhookType {\n /** Incoming Webhooks can post messages to channels with a generated token */\n INCOMING = 1,\n /** Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels */\n CHANNEL_FOLLOWER = 2,\n /** Application webhooks are webhooks used with Interactions */\n APPLICATION = 3,\n}\n\n/** https://discord.com/developers/docs/topics/gateway#webhooks-update-webhook-update-event-fields */\nexport interface WebhooksUpdateEvent {\n /** id of the guild */\n guild_id: snowflake\n /** id of the channel */\n channel_id: snowflake\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild channel webhook was created, update, or deleted */\n WEBHOOKS_UPDATE: WebhooksUpdateEvent\n }\n}\n\nexport interface ModifyWebhookParams {\n /** the default name of the webhook */\n name?: string\n /** data\timage for the default webhook avatar */\n avatar?: string\n /** the new channel id this webhook should be moved to */\n channel_id?: snowflake\n}\n\ndeclare module './internal' {\n interface Internal {\n /** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */\n getChannelWebhooks(channel_id: snowflake): Promise<Webhook[]>\n /** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */\n getGuildWebhooks(guild_id: snowflake): Promise<Webhook[]>\n /** https://discord.com/developers/docs/resources/webhook#get-webhook */\n getWebhook(webhook_id: snowflake): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-with-token */\n getWebhookWithToken(webhook_id: snowflake, token: string): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook */\n modifyWebhook(webhook_id: snowflake, options: ModifyWebhookParams): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */\n modifyWebhookWithToken(webhook_id: snowflake, token: string, options: ModifyWebhookParams): Promise<Webhook>\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook */\n deleteWebhook(webhook_id: snowflake): Promise<void>\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */\n deleteWebhookWithToken(webhook_id: snowflake, token: string): Promise<void>\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook */\n /** https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook */\n /** https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook */\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-message */ \n getWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake): Promise<Message>\n /** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */\n /** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */\n deleteWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/webhooks': {\n POST: 'createWebhook',\n GET: 'getChannelWebhooks',\n },\n '/guilds/{guild.id}/webhooks': {\n GET: 'getGuildWebhooks',\n },\n '/webhooks/{webhook.id}': {\n GET: 'getWebhook',\n PATCH: 'modifyWebhook',\n DELETE: 'deleteWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}': {\n GET: 'getWebhookwithToken',\n PATCH: 'modifyWebhookwithToken',\n DELETE: 'deleteWebhookwithToken',\n POST: 'executeWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/slack': {\n POST: 'executeSlackCompatibleWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/github': {\n POST: 'executeGitHubCompatibleWebhook',\n },\n '/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}': {\n GET: 'getWebhookMessage',\n PATCH: 'editWebhookMessage',\n DELETE: 'deleteWebhookMessage',\n },\n})\n", "import { Adapter, Context, Logger, renameProperty } from 'koishi'\nimport { GatewayOpcode, GatewayPayload, GatewayIntent } from './types'\nimport { adaptSession, adaptUser, AdapterConfig } from './utils'\nimport { BotConfig, DiscordBot } from './bot'\nimport WebSocket from 'ws'\n\nconst logger = new Logger('discord')\n\nexport default class WebSocketClient extends Adapter.WebSocketClient<BotConfig, AdapterConfig> {\n static schema = BotConfig\n\n constructor(ctx: Context, config: AdapterConfig) {\n super(ctx, config)\n this.http = ctx.http.extend({\n endpoint: 'https://discord.com/api/v8',\n ...config.request,\n })\n }\n\n prepare() {\n return new WebSocket('wss://gateway.discord.gg/?v=8&encoding=json')\n }\n\n heartbeat(bot: DiscordBot) {\n logger.debug(`heartbeat d ${bot._d}`)\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.HEARTBEAT,\n d: bot._d,\n }))\n }\n\n accept(bot: DiscordBot) {\n if (bot._sessionId) {\n logger.debug('resuming')\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.RESUME,\n d: {\n token: bot.config.token,\n session_id: bot._sessionId,\n seq: bot._d,\n },\n }))\n }\n\n bot.socket.on('message', async (data) => {\n data = data.toString()\n let parsed: GatewayPayload\n try {\n parsed = JSON.parse(data)\n } catch (error) {\n return logger.warn('cannot parse message', data)\n }\n logger.debug(require('util').inspect(parsed, false, null, true))\n if (parsed.s) {\n bot._d = parsed.s\n }\n\n // https://discord.com/developers/docs/topics/gateway#identifying\n if (parsed.op === GatewayOpcode.HELLO) {\n bot._ping = setInterval(() => this.heartbeat(bot), parsed.d.heartbeat_interval)\n if (bot._sessionId) return\n bot.socket.send(JSON.stringify({\n op: GatewayOpcode.IDENTIFY,\n d: {\n token: bot.config.token,\n properties: {},\n compress: false,\n intents: GatewayIntent.GUILD_MEMBERS\n | GatewayIntent.GUILD_MESSAGES\n | GatewayIntent.GUILD_MESSAGE_REACTIONS\n | GatewayIntent.DIRECT_MESSAGES\n | GatewayIntent.DIRECT_MESSAGE_REACTIONS,\n },\n }))\n }\n\n if (parsed.op === GatewayOpcode.DISPATCH) {\n if (parsed.t === 'READY') {\n bot._sessionId = parsed.d.session_id\n const self: any = adaptUser(parsed.d.user)\n renameProperty(self, 'selfId', 'userId')\n Object.assign(bot, self)\n logger.debug('session_id ' + bot._sessionId)\n return bot.resolve()\n }\n const session = await adaptSession(bot, parsed)\n if (session) this.dispatch(session)\n }\n })\n\n bot.socket.on('close', () => {\n clearInterval(bot._ping)\n })\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;;;ACExB,qBAA4D;;;ACD5D,oBAA4D;AAMrD,IAAM,gBAAuC,qBAAO,UAAU;AAAA,EACnE,kBAAI,OAAO;AAAA,EACX,sBAAQ,gBAAgB;AAAA;AAGnB,IAAM,YAAY,wBAAC,SAA6B;AAAA,EACrD,QAAQ,KAAK;AAAA,EACb,QAAQ,sCAAsC,KAAK,MAAM,KAAK;AAAA,EAC9D,UAAU,KAAK;AAAA,EACf,eAAe,KAAK;AAAA,EACpB,OAAO,KAAK,OAAO;AAAA,IALI;AAQlB,oBAAoB,MAA2B;AACpD,SAAO;AAAA,IACL,SAAS,KAAK;AAAA,IACd,WAAW,KAAK;AAAA;AAAA;AAHJ;AAOT,sBAAsB,MAA+B;AAC1D,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,IAChB,aAAa,KAAK;AAAA;AAAA;AAHN;AAOT,IAAM,cAAc,wBAAC,WAAiC,iCACxD,UAAU,UAD8C;AAAA,EAE3D,UAAU,OAAO;AAAA,IAFQ;AAKpB,sBAAsB,KAAiB,MAAkB,UAA4B,IAAI;AAvChG;AAwCE,MAAI,KAAK,QAAQ;AACf,YAAQ,SAAS,YAAY,KAAK;AAClC,YAAQ,SAAS,KAAK,OAAO;AAAA;AAE/B,MAAI,WAAK,WAAL,mBAAa,MAAM;AACrB,YAAQ,OAAO,WAAW,WAAK,WAAL,mBA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+ /// <reference path="index.d.ts" />
2
+ /// <reference types="koishi/lib" />
1
3
  import { Adapter, Context } from 'koishi';
2
4
  import { AdapterConfig } from './utils';
3
5
  import { BotConfig, DiscordBot } from './bot';
4
6
  import WebSocket from 'ws';
5
7
  export default class WebSocketClient extends Adapter.WebSocketClient<BotConfig, AdapterConfig> {
6
- static schema: import("schemastery")<unknown>;
8
+ static schema: import("schemastery").Schema<unknown, any>;
7
9
  constructor(ctx: Context, config: AdapterConfig);
8
10
  prepare(): WebSocket;
9
11
  heartbeat(bot: DiscordBot): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koishijs/plugin-adapter-discord",
3
3
  "description": "Discord adapter for Koishi",
4
- "version": "2.0.0-beta.2",
4
+ "version": "2.0.0-beta.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "author": "LittleC <i@ltlec.cn>",
11
11
  "maintainers": [
12
- "Shigma <1700011071@pku.edu.cn>",
12
+ "Shigma <shigma10826@gmail.com>",
13
13
  "LittleC <i@ltlec.cn>"
14
14
  ],
15
15
  "license": "MIT",
@@ -28,12 +28,12 @@
28
28
  "koishi"
29
29
  ],
30
30
  "peerDependencies": {
31
- "koishi": "^4.0.0-beta.2"
31
+ "koishi": "^4.0.0-beta.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/es-aggregate-error": "^1.0.2",
35
35
  "@types/ws": "^7.4.7",
36
- "@koishijs/test-utils": "^8.0.0-beta.2"
36
+ "@koishijs/test-utils": "^8.0.0-beta.3"
37
37
  },
38
38
  "dependencies": {
39
39
  "es-aggregate-error": "^1.0.5",