@satorijs/adapter-discord 4.0.0 → 4.0.2

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/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/types/internal.ts", "../src/types/application.ts", "../src/types/application-role-connection.ts", "../src/types/audit-log.ts", "../src/types/auto-moderation.ts", "../src/types/ban.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/reaction.ts", "../src/types/role.ts", "../src/types/scheduled-event.ts", "../src/types/stage-instance.ts", "../src/types/sticker.ts", "../src/types/team.ts", "../src/types/thread.ts", "../src/types/user.ts", "../src/types/voice.ts", "../src/types/webhook.ts", "../src/types/index.ts", "../src/message.ts", "../src/ws.ts"],
4
- "sourcesContent": ["import { DiscordBot } from './bot'\nimport * as Discord from './utils'\n\nexport { Discord }\n\nexport * from './bot'\nexport * from './message'\nexport * from './ws'\n\nexport default DiscordBot\n\ntype ParamCase<S extends string> =\n | S extends `${infer L}${infer R}`\n ? `${L extends '_' ? '-' : Lowercase<L>}${ParamCase<R>}`\n : S\n\ntype DiscordEvents = {\n [T in keyof Discord.GatewayEvents as `discord/${ParamCase<T>}`]: (input: Discord.GatewayEvents[T]) => void\n}\n\ndeclare module '@satorijs/core' {\n interface Session {\n discord?: Discord.Gateway.Payload & Discord.Internal\n }\n\n interface Events extends DiscordEvents {}\n}\n", "import { Bot, Context, defineProperty, Fragment, h, isNullable, Logger, Quester, Schema, SendOptions, Universal } from '@satorijs/satori'\nimport { decodeChannel, decodeGuild, decodeMessage, decodeRole, decodeUser, encodeRole } from './utils'\nimport * as Discord from './utils'\nimport { DiscordMessageEncoder } from './message'\nimport { Internal, Webhook } from './types'\nimport { WsClient } from './ws'\n\n// @ts-ignore\nimport { version } from '../package.json'\n\nconst logger = new Logger('discord')\n\nexport class DiscordBot extends Bot<DiscordBot.Config> {\n static MessageEncoder = DiscordMessageEncoder\n\n public http: Quester\n public internal: Internal\n public webhooks: Record<string, Webhook> = {}\n public webhookLock: Record<string, Promise<Webhook>> = {}\n public commands: Universal.Command[] = []\n\n constructor(ctx: Context, config: DiscordBot.Config) {\n super(ctx, config)\n this.platform = 'discord'\n this.http = ctx.http.extend({\n ...config,\n headers: {\n Authorization: `Bot ${config.token}`,\n 'User-Agent': `Koishi (https://koishi.chat/, ${version})`,\n ...config.headers,\n },\n })\n this.internal = new Internal(this.http)\n ctx.plugin(WsClient, this)\n }\n\n session(payload?: any, input?: any) {\n return defineProperty(super.session(payload), 'discord', Object.assign(Object.create(this.internal), input))\n }\n\n private async _ensureWebhook(channelId: string) {\n let webhook: Webhook\n const webhooks = await this.internal.getChannelWebhooks(channelId)\n const selfId = this.selfId\n if (!webhooks.find(v => v.name === 'Koishi' && v.user.id === selfId)) {\n webhook = await this.internal.createWebhook(channelId, {\n name: 'Koishi',\n })\n // webhook may be `AxiosError: Request failed with status code 429` error\n } else {\n webhook = webhooks.find(v => v.name === 'Koishi' && v.user.id === this.selfId)\n }\n return this.webhooks[channelId] = webhook\n }\n\n async ensureWebhook(channelId: string) {\n if (this.webhooks[channelId] === null) {\n delete this.webhooks[channelId]\n delete this.webhookLock[channelId]\n }\n if (this.webhooks[channelId]) {\n delete this.webhookLock[channelId]\n return this.webhooks[channelId]\n }\n return this.webhookLock[channelId] ||= this._ensureWebhook(channelId)\n }\n\n async getSelf() {\n const data = await this.internal.getCurrentUser()\n return decodeUser(data)\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: Fragment) {\n const elements = h.normalize(content)\n content = elements.toString()\n const image = elements.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) {\n const data = await this.internal.getChannelMessage(channelId, messageId)\n return await decodeMessage(this, data)\n }\n\n async getMessageList(channelId: string, before?: string) {\n const messages = await this.internal.getChannelMessages(channelId, { before, limit: 100 })\n const data = await Promise.all(messages.reverse().map(data => decodeMessage(this, data, {}, false)))\n return { data, next: data[0]?.messageId }\n }\n\n async getUser(userId: string) {\n const data = await this.internal.getUser(userId)\n return decodeUser(data)\n }\n\n async getGuildMemberList(guildId: string, after?: string) {\n const users = await this.internal.listGuildMembers(guildId, { after, limit: 1000 })\n const data = users.map(v => decodeUser(v.user))\n return { data, next: data[999]?.userId }\n }\n\n async getChannel(channelId: string) {\n const data = await this.internal.getChannel(channelId)\n return decodeChannel(data)\n }\n\n async getGuildMember(guildId: string, userId: string) {\n const member = await this.internal.getGuildMember(guildId, userId)\n return {\n ...decodeUser(member.user),\n nickname: member.nick,\n }\n }\n\n async kickGuildMember(guildId: string, userId: string) {\n return this.internal.removeGuildMember(guildId, userId)\n }\n\n async getGuild(guildId: string) {\n const data = await this.internal.getGuild(guildId)\n return decodeGuild(data)\n }\n\n async getGuildList(after?: string) {\n const guilds = await this.internal.getCurrentUserGuilds({ after, limit: 200 })\n const data = guilds.map(decodeGuild)\n return { data, next: data[199]?.id }\n }\n\n async getChannelList(guildId: string) {\n const channels = await this.internal.getGuildChannels(guildId)\n return { data: channels.map(decodeChannel) }\n }\n\n createReaction(channelId: string, messageId: string, emoji: string) {\n return this.internal.createReaction(channelId, messageId, emoji)\n }\n\n deleteReaction(channelId: string, messageId: string, emoji: string, userId?: string) {\n if (!userId) {\n return this.internal.deleteOwnReaction(channelId, messageId, emoji)\n } else {\n return this.internal.deleteUserReaction(channelId, messageId, emoji, userId)\n }\n }\n\n clearReaction(channelId: string, messageId: string, emoji?: string) {\n if (!emoji) {\n return this.internal.deleteAllReactions(channelId, messageId)\n } else {\n return this.internal.deleteAllReactionsForEmoji(channelId, messageId, emoji)\n }\n }\n\n async getReactionList(channelId: string, messageId: string, emoji: string, after?: string) {\n const data = await this.internal.getReactions(channelId, messageId, emoji, { after, limit: 100 })\n return { data: data.map(decodeUser), next: data[99]?.id }\n }\n\n setGuildMemberRole(guildId: string, userId: string, roleId: string) {\n return this.internal.addGuildMemberRole(guildId, userId, roleId)\n }\n\n unsetGuildMemberRole(guildId: string, userId: string, roleId: string) {\n return this.internal.removeGuildMemberRole(guildId, userId, roleId)\n }\n\n async getGuildRoleList(guildId: string) {\n const data = await this.internal.getGuildRoles(guildId)\n return { data: data.map(decodeRole) }\n }\n\n async createGuildRole(guildId: string, data: Partial<Universal.Role>) {\n const role = await this.internal.createGuildRole(guildId, encodeRole(data))\n return role.id\n }\n\n async modifyGuildRole(guildId: string, roleId: string, data: Partial<Universal.Role>) {\n await this.internal.modifyGuildRole(guildId, roleId, encodeRole(data))\n }\n\n deleteGuildRole(guildId: string, roleId: string) {\n return this.internal.deleteGuildRole(guildId, roleId)\n }\n\n async sendPrivateMessage(userId: string, content: Fragment, options?: SendOptions) {\n const channel = await this.internal.createDM({\n recipient_id: userId,\n })\n return this.sendMessage(channel.id, content, null, options)\n }\n\n async updateCommands(commands: Universal.Command[]) {\n if (!this.config.slash) return\n this.commands = commands\n const local = Object.fromEntries(commands.map(cmd => [cmd.name, cmd] as const))\n const remote = Object.fromEntries((await this.internal.getGlobalApplicationCommands(this.selfId, { with_localizations: true }))\n .filter(cmd => cmd.type === Discord.ApplicationCommand.Type.CHAT_INPUT)\n .map(cmd => [cmd.name, cmd] as const))\n const updates: any[] = []\n for (const key in { ...local, ...remote }) {\n if (!local[key]) {\n logger.debug('delete command %s', key)\n await this.internal.deleteGlobalApplicationCommand(this.selfId, remote[key].id)\n continue\n }\n const data = Discord.encodeCommand(local[key])\n logger.debug(data, remote[key])\n if (!remote[key]) {\n logger.debug('create command: %s', local[key].name)\n updates.push(data)\n } else if (!shapeEqual(data, remote[key])) {\n logger.debug('edit command: %s', local[key].name)\n updates.push(data)\n }\n }\n if (updates.length) {\n await this.internal.bulkOverwriteGlobalApplicationCommands(this.selfId, updates)\n }\n }\n}\n\nfunction shapeEqual(a: any, b: any) {\n if (a === b) return true\n if (isNullable(a) && isNullable(b)) return true\n\n if (typeof a !== typeof b) return false\n if (typeof a !== 'object') return false\n if (Object.values(a).every(isNullable) && isNullable(b)) return true\n // ^ a = { foo: undefined }, b = null\n if (!a || !b) return false\n\n // check array\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) return false\n return a.every((item, index) => shapeEqual(item, b[index]))\n } else if (Array.isArray(b)) {\n return false\n }\n\n // check object\n return Object.keys(a).every(key => shapeEqual(a[key], b[key]))\n}\n\nexport namespace DiscordBot {\n export interface Config extends Bot.Config, Quester.Config, DiscordMessageEncoder.Config, WsClient.Config {\n token: string\n slash?: boolean\n }\n\n export const Config: Schema<Config> = Schema.intersect([\n Schema.object({\n token: Schema.string().description('机器人的用户令牌。').role('secret').required(),\n }),\n Schema.object({\n slash: Schema.boolean().description('是否启用斜线指令。').default(true),\n }).description('功能设置'),\n WsClient.Config,\n DiscordMessageEncoder.Config,\n Quester.createConfig('https://discord.com/api/v10'),\n ])\n}\n", "import { Dict, h, pick, Session, Universal, valueMap } from '@satorijs/satori'\nimport { DiscordBot } from './bot'\nimport * as Discord from './types'\n\nexport * from './types'\n\nexport const sanitize = (val: string) =>\n val\n .replace(/[\\\\*_`~|()\\[\\]]/g, '\\\\$&')\n .replace(/@everyone/g, () => '\\\\@everyone')\n .replace(/@here/g, () => '\\\\@here')\n\nexport const decodeUser = (user: Discord.User): Universal.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 const decodeGuild = (data: Discord.Guild): Universal.Guild => ({\n id: data.id,\n name: data.name,\n guildId: data.id,\n guildName: data.name,\n})\n\nexport const decodeChannel = (data: Discord.Channel): Universal.Channel => ({\n id: data.id,\n name: data.name,\n channelId: data.id,\n channelName: data.name,\n})\n\nexport const decodeAuthor = (author: Discord.User): Universal.Author => ({\n ...decodeUser(author),\n nickname: author.username,\n})\n\nexport const decodeRole = (role: Discord.Role): Universal.Role => ({\n ...role,\n permissions: BigInt(role.permissions),\n})\n\nexport const encodeRole = (role: Partial<Universal.Role>): Partial<Discord.Role> => ({\n ...role,\n permissions: role.permissions && '' + role.permissions,\n})\n\nexport async function decodeMessage(bot: DiscordBot, meta: Discord.Message, session: Partial<Session> = {}, reference = true) {\n const { platform } = bot\n\n session.messageId = meta.id\n session.channelId = meta.channel_id\n session.timestamp = new Date(meta.timestamp).valueOf() || Date.now()\n if (meta.author) {\n session.author = decodeAuthor(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(/<@[!&]?(.+?)>/g, (_, id) => {\n if (meta.mention_roles.includes(id)) {\n return h('at', { role: id }).toString()\n } else {\n const user = meta.mentions?.find(u => u.id === id || `${u.username}#${u.discriminator}` === id)\n return h.at(id, { name: user?.username }).toString()\n }\n })\n .replace(/<a?:(.*):(.+?)>/g, (_, name, id) => {\n const animated = _[1] === 'a'\n return h('face', { id, name, animated, platform }, [\n h.image(`https://cdn.discordapp.com/emojis/${id}.gif?quality=lossless`),\n ]).toString()\n })\n .replace(/@everyone/g, () => h('at', { type: 'all' }).toString())\n .replace(/@here/g, () => h('at', { type: 'here' }).toString())\n .replace(/<#(.+?)>/g, (_, id) => {\n const channel = meta.mention_channels?.find(c => c.id === id)\n return h.sharp(id, { name: channel?.name }).toString()\n })\n }\n\n // embed 的 update event 太阴间了 只有 id embeds channel_id guild_id 四个成员\n if (meta.attachments?.length) {\n if (session.content) session.content += ' '\n session.content += meta.attachments.map(v => {\n if (v.height && v.width && v.content_type?.startsWith('image/')) {\n return h('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 h('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 h('record', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else {\n return h('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 += h('image', { url: embed.image.url, proxy_url: embed.image.proxy_url })\n }\n if (embed.thumbnail) {\n session.content += h('image', { url: embed.thumbnail.url, proxy_url: embed.thumbnail.proxy_url })\n }\n if (embed.video) {\n session.content += h('video', { url: embed.video.url, proxy_url: embed.video.proxy_url })\n }\n }\n session.elements = h.parse(session.content)\n // 遇到过 cross post 的消息在这里不会传消息 id\n if (reference && meta.message_reference) {\n const { message_id, channel_id } = meta.message_reference\n session.quote = await bot.getMessage(channel_id, message_id)\n }\n return session as Universal.Message\n}\n\nexport function setupMessageGuildId(session: Partial<Session>, guildId: string) {\n session.guildId = guildId\n session.isDirect = !guildId\n session.subtype = guildId ? 'group' : 'private'\n}\n\ntype ReactionEvent = Partial<\n & Discord.Reaction.Event.Add\n & Discord.Reaction.Event.Remove\n & Discord.Reaction.Event.RemoveAll\n & Discord.Reaction.Event.RemoveEmoji>\n\nfunction setupReaction(session: Partial<Session>, data: ReactionEvent) {\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.isDirect = !data.guild_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: Discord.Gateway.Payload) {\n const session = bot.session({}, input)\n if (input.t === 'MESSAGE_CREATE') {\n setupMessageGuildId(session, input.d.guild_id)\n if (input.d.webhook_id && !session.isDirect) {\n try {\n // 403 Missing Permissions\n const webhook = await bot.ensureWebhook(input.d.channel_id)\n // koishi's webhook\n if (webhook.id === input.d.webhook_id) return\n } catch (e) {}\n }\n session.type = 'message'\n await decodeMessage(bot, input.d, session)\n // dc 情况特殊 可能有 embeds 但是没有消息主体\n // if (!session.content) return\n } else if (input.t === 'MESSAGE_UPDATE') {\n session.type = 'message-updated'\n const message = 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-events#message-update\n await decodeMessage(bot, message, session)\n const channel = await bot.internal.getChannel(input.d.channel_id)\n setupMessageGuildId(session, channel.guild_id)\n // if (!session.content) return\n } else if (input.t === 'MESSAGE_DELETE') {\n session.type = 'message-deleted'\n session.messageId = input.d.id\n session.channelId = input.d.channel_id\n setupMessageGuildId(session, input.d.guild_id)\n } else if (input.t === 'MESSAGE_REACTION_ADD') {\n session.type = 'reaction-added'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE') {\n session.type = 'reaction-deleted'\n session.subtype = 'one'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_ALL') {\n session.type = 'reaction-deleted'\n session.subtype = 'all'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_EMOJI') {\n session.type = 'reaction-deleted'\n session.subtype = 'emoji'\n setupReaction(session, input.d)\n } else if (input.t === 'GUILD_ROLE_CREATE') {\n session.type = 'guild-role-added'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role.id\n session.data.role = decodeRole(input.d.role)\n } else if (input.t === 'GUILD_ROLE_UPDATE') {\n session.type = 'guild-role-updated'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role.id\n session.data.role = decodeRole(input.d.role)\n } else if (input.t === 'GUILD_ROLE_DELETE') {\n session.type = 'guild-role-added'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role_id\n } else if (input.t === 'INTERACTION_CREATE' && input.d.type === Discord.Interaction.Type.APPLICATION_COMMAND) {\n const data = input.d.data as Discord.InteractionData.ApplicationCommand\n const command = bot.commands.find(cmd => cmd.name === data.name)\n if (!command) return\n await bot.internal.createInteractionResponse(input.d.id, input.d.token, {\n type: Discord.Interaction.CallbackType.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE,\n })\n session.type = 'interaction/command'\n session.isDirect = !input.d.guild_id\n session.subtype = input.d.guild_id ? 'group' : 'private'\n session.channelId = input.d.channel_id\n session.guildId = input.d.guild_id\n session.userId = session.isDirect ? input.d.user.id : input.d.member.user.id\n session.messageId = input.d.id\n session.content = ''\n session.data.argv = decodeArgv(data, command)\n } else if (input.t === 'CHANNEL_UPDATE') {\n session.type = 'channel-updated'\n session.guildId = input.d.guild_id\n session.subtype = input.d.guild_id ? 'group' : 'private'\n session.channelId = input.d.id\n } else {\n return\n }\n return session\n}\n\nconst types = {\n text: Discord.ApplicationCommand.OptionType.STRING,\n string: Discord.ApplicationCommand.OptionType.STRING,\n boolean: Discord.ApplicationCommand.OptionType.BOOLEAN,\n number: Discord.ApplicationCommand.OptionType.NUMBER,\n integer: Discord.ApplicationCommand.OptionType.INTEGER,\n posint: Discord.ApplicationCommand.OptionType.INTEGER,\n user: Discord.ApplicationCommand.OptionType.STRING,\n channel: Discord.ApplicationCommand.OptionType.STRING,\n guild: Discord.ApplicationCommand.OptionType.STRING,\n}\n\ninterface Description {\n name: string\n description: Dict<string>\n}\n\nconst trimDescription = (source: string) => {\n if (!source || source.length < 96) return source\n return source.slice(0, 93) + '...'\n}\n\nconst encodeDescription = (object: Description) => ({\n description: trimDescription(object.description[''] || object.name),\n description_localizations: valueMap(pick(object.description, Discord.Locale), trimDescription),\n})\n\nexport const encodeCommand = (cmd: Universal.Command): Discord.ApplicationCommand.Params.Create => ({\n ...encodeDescription(cmd),\n name: cmd.name,\n type: Discord.ApplicationCommand.Type.CHAT_INPUT,\n options: encodeCommandOptions(cmd),\n})\n\nconst decodeArgv = (data: Discord.InteractionData.ApplicationCommand, command: Universal.Command) => {\n const result = { name: data.name, arguments: [], options: {} } as Universal.Argv\n for (const argument of command.arguments) {\n const value = data.options?.find(opt => opt.name === argument.name)?.value\n if (value !== undefined) result.arguments.push(value)\n }\n for (const option of command.options) {\n const value = data.options?.find(opt => opt.name === option.name)?.value\n if (value !== undefined) result.options[option.name] = value\n }\n return result\n}\n\nexport function encodeCommandOptions(cmd: Universal.Command): Discord.ApplicationCommand.Option[] {\n const result: Discord.ApplicationCommand.Option[] = []\n if (cmd.children.length) {\n result.push(...cmd.children.map(child => ({\n name: child.name.slice(cmd.name.length + 1),\n type: child.children.length\n ? Discord.ApplicationCommand.OptionType.SUB_COMMAND_GROUP\n : Discord.ApplicationCommand.OptionType.SUB_COMMAND,\n options: encodeCommandOptions(child),\n description: cmd.description[''] || child.name,\n description_localizations: pick(cmd.description, Discord.Locale),\n })))\n } else {\n // `getGlobalApplicationCommands()` does not return `required` property.\n for (const arg of cmd.arguments) {\n result.push({\n ...encodeDescription(arg),\n name: arg.name.toLowerCase().replace(/[^a-z0-9]/g, ''),\n type: types[arg.type] ?? types.text,\n // required: arg.required ?? false,\n })\n }\n for (const option of cmd.options) {\n result.push({\n ...encodeDescription(option),\n name: option.name.toLowerCase(),\n type: types[option.type] ?? types.text,\n // required: option.required ?? false,\n min_value: option.type === 'posint' ? 1 : undefined,\n })\n }\n }\n return result.sort((a, b) => +b.required - +a.required)\n}\n", "import { Dict, makeArray, Quester } from '@satorijs/satori'\n\nexport class Internal {\n constructor(private http: Quester) {}\n\n static define(routes: Dict<Partial<Record<Quester.Method, string | string[]>>>) {\n for (const path in routes) {\n for (const key in routes[path]) {\n const method = key as Quester.Method\n for (const name of makeArray(routes[path][method])) {\n Internal.prototype[name] = async function (this: Internal, ...args: any[]) {\n const raw = args.join(', ')\n const url = path.replace(/\\{([^}]+)\\}/g, () => {\n if (!args.length) throw new Error(`too few arguments for ${path}, received ${raw}`)\n return args.shift()\n })\n const config: Quester.AxiosRequestConfig = {}\n if (args.length === 1) {\n if (method === 'GET' || method === 'DELETE') {\n config.params = args[0]\n } else {\n config.data = args[0]\n }\n } else if (args.length === 2 && method !== 'GET' && method !== 'DELETE') {\n config.data = args[0]\n config.params = args[1]\n } else if (args.length > 1) {\n throw new Error(`too many arguments for ${path}, received ${raw}`)\n }\n try {\n return await this.http(method, url, config)\n } catch (error) {\n if (!Quester.isAxiosError(error) || !error.response) throw error\n throw new Error(`[${error.response.status}] ${JSON.stringify(error.response.data)}`)\n }\n }\n }\n }\n }\n }\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 /** deprecated, 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 /** up to 5 tags describing the content and functionality of the application */\n tags?: [string, string?, string?, string?, string?]\n /** settings for the application's default in-app authorization link, if enabled */\n install_params?: InstallParams\n /** the application's default custom authorization link, if enabled */\n custom_install_url?: string\n /** the application's role connection verification entry point, which when configured will render the app as a verification method in the guild role verification configuration */\n role_connections_verification_url?: string\n}\n\nexport interface InstallParams {\n /** the scopes to add the application to the server with */\n scopes: string[]\n /** the permissions to request for the bot role */\n permissions: string\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 GATEWAY_MESSAGE_CONTENT = 1 << 18,\n GATEWAY_MESSAGE_CONTENT_LIMITED = 1 << 19,\n APPLICATION_COMMAND_BADGE = 1 << 23,\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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 /** gateway URL for resuming connections */\n resume_gateway_url: 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 /** response to Resume */\n RESUMED: {}\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the bot's application object.\n * @see https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information\n */\n getCurrentBotApplicationInformation(): Promise<Application>\n /**\n * Returns info about the current authorization. Requires authentication with a bearer token.\n * @see https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information\n */\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 { Internal, Locale } from '.'\n\nexport namespace ApplicationRoleConnection {\n /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */\n export interface Metadata {\n /** type of metadata value */\n type: MetadataType\n /** dictionary key for the metadata field (must be a-z, 0-9, or _ characters; 1-50 characters) */\n key: string\n /** name of the metadata field (1-100 characters) */\n name: string\n /** translations of the name */\n name_localizations?: Record<Locale, string>\n /** description of the metadata field (1-200 characters) */\n description: string\n /** translations of the description */\n description_localizations?: Record<Locale, string>\n }\n\n /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type */\n export enum MetadataType {\n /** the metadata value (integer) is less than or equal to the guild's configured value (integer) */\n INTEGER_LESS_THAN_OR_EQUAL = 1,\n /** the metadata value (integer) is greater than or equal to the guild's configured value (integer) */\n INTEGER_GREATER_THAN_OR_EQUAL = 2,\n /** the metadata value (integer) is equal to the guild's configured value (integer) */\n INTEGER_EQUAL = 3,\n /** the metadata value (integer) is not equal to the guild's configured value (integer) */\n INTEGER_NOT_EQUAL = 4,\n /** the metadata value (ISO8601 string) is less than or equal to the guild's configured value (integer; days before current date) */\n DATETIME_LESS_THAN_OR_EQUAL = 5,\n /** the metadata value (ISO8601 string) is greater than or equal to the guild's configured value (integer; days before current date) */\n DATETIME_GREATER_THAN_OR_EQUAL = 6,\n /** the metadata value (integer) is equal to the guild's configured value (integer; 1) */\n BOOLEAN_EQUAL = 7,\n /** the metadata value (integer) is not equal to the guild's configured value (integer; 1) */\n BOOLEAN_NOT_EQUAL = 8,\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of application role connection metadata objects for the given application.\n * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records\n */\n getApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>\n /**\n * Updates and returns a list of application role connection metadata objects for the given application.\n * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records\n */\n updateApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>\n }\n}\n\nInternal.define({\n '/applications/{application.id}/role-connections/metadata': {\n GET: 'getApplicationRoleConnectionMetadataRecords',\n PUT: 'updateApplicationRoleConnectionMetadataRecords',\n },\n})\n", "import { ApplicationCommand, AutoModerationRule, Channel, GuildScheduledEvent, integer, 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 application commands referenced in the audit log */\n application_commands: ApplicationCommand[]\n /** list of audit log entries */\n audit_log_entries: AuditLog.Entry[]\n /** list of auto moderation rules referenced in the audit log */\n auto_moderation_rules: AutoModerationRule[]\n /** list of guild scheduled events referenced in the audit log */\n guild_scheduled_events: GuildScheduledEvent[]\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\nexport namespace AuditLog {\n /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */\n export interface Entry {\n /** id of the affected entity (webhook, user, role, etc.) */\n target_id?: string\n /** changes made to the target_id */\n changes?: Change[]\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: Type\n /** additional info for certain action types */\n options?: OptionalInfo\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 */\n export enum Type {\n /** Server settings were updated */\n GUILD_UPDATE = 1,\n /** Channel was created */\n CHANNEL_CREATE = 10,\n /** Channel settings were updated */\n CHANNEL_UPDATE = 11,\n /** Channel was deleted */\n CHANNEL_DELETE = 12,\n /** Permission overwrite was added to a channel */\n CHANNEL_OVERWRITE_CREATE = 13,\n /** Permission overwrite was updated for a channel */\n CHANNEL_OVERWRITE_UPDATE = 14,\n /** Permission overwrite was deleted from a channel */\n CHANNEL_OVERWRITE_DELETE = 15,\n /** Member was removed from server */\n MEMBER_KICK = 20,\n /** Members were pruned from server */\n MEMBER_PRUNE = 21,\n /** Member was banned from server */\n MEMBER_BAN_ADD = 22,\n /** Server ban was lifted for a member */\n MEMBER_BAN_REMOVE = 23,\n /** Member was updated in server */\n MEMBER_UPDATE = 24,\n /** Member was added or removed from a role */\n MEMBER_ROLE_UPDATE = 25,\n /** Member was moved to a different voice channel */\n MEMBER_MOVE = 26,\n /** Member was disconnected from a voice channel */\n MEMBER_DISCONNECT = 27,\n /** Bot user was added to server */\n BOT_ADD = 28,\n /** Role was created */\n ROLE_CREATE = 30,\n /** Role was edited */\n ROLE_UPDATE = 31,\n /** Role was deleted */\n ROLE_DELETE = 32,\n /** Server invite was created */\n INVITE_CREATE = 40,\n /** Server invite was updated */\n INVITE_UPDATE = 41,\n /** Server invite was deleted */\n INVITE_DELETE = 42,\n /** Webhook was created */\n WEBHOOK_CREATE = 50,\n /** Webhook properties or channel were updated */\n WEBHOOK_UPDATE = 51,\n /** Webhook was deleted */\n WEBHOOK_DELETE = 52,\n /** Emoji was created */\n EMOJI_CREATE = 60,\n /** Emoji name was updated */\n EMOJI_UPDATE = 61,\n /** Emoji was deleted */\n EMOJI_DELETE = 62,\n /** Single message was deleted */\n MESSAGE_DELETE = 72,\n /** Multiple messages were deleted */\n MESSAGE_BULK_DELETE = 73,\n /** Message was pinned to a channel */\n MESSAGE_PIN = 74,\n /** Message was unpinned from a channel */\n MESSAGE_UNPIN = 75,\n /** App was added to server */\n INTEGRATION_CREATE = 80,\n /** App was updated (as an example, its scopes were updated) */\n INTEGRATION_UPDATE = 81,\n /** App was removed from server */\n INTEGRATION_DELETE = 82,\n /** Stage instance was created (stage channel becomes live) */\n STAGE_INSTANCE_CREATE = 83,\n /** Stage instance details were updated */\n STAGE_INSTANCE_UPDATE = 84,\n /** Stage instance was deleted (stage channel no longer live) */\n STAGE_INSTANCE_DELETE = 85,\n /** Sticker was created */\n STICKER_CREATE = 90,\n /** Sticker details were updated */\n STICKER_UPDATE = 91,\n /** Sticker was deleted */\n STICKER_DELETE = 92,\n /** Event was created */\n GUILD_SCHEDULED_EVENT_CREATE = 100,\n /** Event was updated */\n GUILD_SCHEDULED_EVENT_UPDATE = 101,\n /** Event was cancelled */\n GUILD_SCHEDULED_EVENT_DELETE = 102,\n /** Thread was created in a channel */\n THREAD_CREATE = 110,\n /** Thread was updated */\n THREAD_UPDATE = 111,\n /** Thread was deleted */\n THREAD_DELETE = 112,\n /** Permissions were updated for a command */\n APPLICATION_COMMAND_PERMISSION_UPDATE = 121,\n /** Auto Moderation rule was created */\n AUTO_MODERATION_RULE_CREATE = 140,\n /** Auto Moderation rule was updated */\n AUTO_MODERATION_RULE_UPDATE = 141,\n /** Auto Moderation rule was deleted */\n AUTO_MODERATION_RULE_DELETE = 142,\n /** Message was blocked by AutoMod */\n AUTO_MODERATION_BLOCK_MESSAGE = 143,\n /** Message was flagged by AutoMod */\n AUTO_MODERATION_FLAG_TO_CHANNEL = 144,\n /** Member was timed out by AutoMod */\n AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145,\n }\n\n /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */\n export interface OptionalInfo {\n /** ID of the app whose permissions were targeted */\n application_id: snowflake\n /** name of the Auto Moderation rule that was triggered */\n auto_moderation_rule_name: string\n /** trigger type of the Auto Moderation rule that was triggered */\n auto_moderation_rule_trigger_type: string\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 */\n export interface Change {\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\n /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-params */\n export interface GetParams {\n /** entries from a specific user ID */\n user_id?: snowflake\n /** entries for a specific audit log event */\n action_type?: Type\n /** entries that preceded a specific audit log entry ID */\n before?: snowflake\n /** entries that succeeded a specific audit log entry ID */\n after?: snowflake\n /** maximum number of entries (between 1-100) to return, defaults to 50 */\n limit?: integer\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an audit log object for the guild. Requires the 'VIEW_AUDIT_LOG' permission.\n * @see https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log\n */\n getGuildAuditLog(guildId: snowflake, params?: AuditLog.GetParams): Promise<AuditLog>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/audit-logs': {\n GET: 'getGuildAuditLog',\n },\n})\n", "import { integer, Internal, snowflake } from '.'\n\n/** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure */\nexport interface AutoModerationRule {\n /** the id of this rule */\n id: snowflake\n /** the id of the guild which this rule belongs to */\n guild_id: snowflake\n /** the rule name */\n name: string\n /** the user which first created this rule */\n creator_id: snowflake\n /** the rule event type */\n event_type: AutoModerationRule.EventType\n /** the rule trigger type */\n trigger_type: AutoModerationRule.TriggerType\n /** the rule trigger metadata */\n trigger_metadata: AutoModerationRule.TriggerMetadata\n /** the actions which will execute when the rule is triggered */\n actions: AutoModerationAction[]\n /** whether the rule is enabled */\n enabled: boolean\n /** the role ids that should not be affected by the rule (Maximum of 20) */\n exempt_roles: snowflake[]\n /** the channel ids that should not be affected by the rule (Maximum of 50) */\n exempt_channels: snowflake[]\n}\n\nexport namespace AutoModerationRule {\n /**\n * Indicates in what event context a rule should be checked.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types\n */\n export const enum EventType {\n /** when a member sends or edits a message in the guild */\n MESSAGE_SEND = 1,\n }\n\n /**\n * Characterizes the type of content which can trigger the rule.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types\n */\n export const enum TriggerType {\n /** check if content contains words from a user defined list of keywords (max per guild: 3) */\n KEYWORD = 1,\n /** check if content represents generic spam (max per guild: 1) */\n SPAM = 3,\n /** check if content contains words from internal pre-defined wordsets (max per guild: 1) */\n KEYWORD_PRESET = 4,\n /** check if content contains more unique mentions than allowed (max per guild: 1) */\n MENTION_SPAM = 5,\n }\n\n /**\n * Additional data used to determine whether a rule should be triggered.\n * Different fields are relevant based on the value of trigger_type.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata\n */\n export interface TriggerMetadata {\n /** associated with `KEYWORD`: substrings which will be searched for in content */\n keyword_filter: string[]\n /** regular expression patterns which will be matched against content (Maximum of 10) */\n regex_patterns: string[]\n /** associated with `KEYWORD_PRESET`: the internally pre-defined wordsets which will be searched for in content */\n presets: KeywordPresetType[]\n /** associated with `KEYWORD_PRESET`: substrings which will be exempt from triggering the preset trigger type */\n allow_list: string[]\n /** associated with `MENTION_SPAM`: total number of unique role and user mentions allowed per message (Maximum of 50) */\n mention_total_limit: integer\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types */\n export const enum KeywordPresetType {\n /** Words that may be considered forms of swearing or cursing */\n PROFANITY = 1,\n /** Words that refer to sexually explicit behavior or activity */\n SEXUAL_CONTEN = 2,\n /** Personal insults or words that may be considered hate speech */\n SLURS = 3,\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule-json-params */\n export interface CreateParams {\n /** the rule name */\n name: string\n /** the event type */\n event_type: EventType\n /** the trigger type */\n trigger_type: TriggerType\n /** the trigger metadata */\n trigger_metadata?: TriggerMetadata\n /** the actions which will execute when the rule is triggered */\n actions: AutoModerationAction[]\n /** whether the rule is enabled (False by default) */\n enabled?: boolean\n /** the role ids that should not be affected by the rule (Maximum of 20) */\n exempt_roles?: snowflake[]\n /** the channel ids that should not be affected by the rule (Maximum of 50) */\n exempt_channels?: snowflake[]\n }\n}\n\n/** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure */\nexport interface AutoModerationAction {\n /** the type of action */\n type: AutoModerationAction.Type\n /** additional metadata needed during execution for this specific action type */\n metadata?: AutoModerationAction.Metadata\n}\n\nexport namespace AutoModerationAction {\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types */\n export const enum Type {\n /** blocks the content of a message according to the rule */\n BLOCK_MESSAGE = 1,\n /** logs user content to a specified channel */\n SEND_ALERT_MESSAGE = 2,\n /**\n * timeout user for a specified duration\n *\n * A `TIMEOUT` action can only be set up for `KEYWORD` and `MENTION_SPAM` rules.\n * The `MODERATE_MEMBERS` permission is required to use the `TIMEOUT` action type.)\n */\n TIMEOUT = 3,\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata */\n export interface Metadata {\n /**\n * associated with `SEND_ALERT_MESSAGE`:\n * channel to which user content should be logged\n */\n channel_id?: snowflake\n /**\n * associated with `TIMEOUT`:\n * timeout duration in seconds, maximum of 2419200 seconds (4 weeks)\n */\n duration_seconds?: integer\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Get a list of all rules currently configured for the guild.\n * Returns a list of auto moderation rule objects for the given guild.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild\n */\n listAutoModerationRules(guildId: snowflake): Promise<AutoModerationRule[]>\n /**\n * Get a single rule. Returns an auto moderation rule object.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule\n */\n getAutoModerationRule(guildId: snowflake, ruleId: snowflake): Promise<AutoModerationRule>\n /**\n * Create a new rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Create Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule\n */\n createAutoModerationRule(guildId: snowflake, data: AutoModerationRule.CreateParams): Promise<AutoModerationRule>\n /**\n * Modify an existing rule. Returns an auto moderation rule on success.\n * Fires an Auto Moderation Rule Update Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule\n */\n modifyAutoModerationRule(guildId: snowflake, ruleId: snowflake, data: Partial<AutoModerationRule.CreateParams>): Promise<AutoModerationRule>\n /**\n * Delete a rule. Returns a 204 on success. Fires an Auto Moderation Rule Delete Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule\n */\n deleteAutoModerationRule(guildId: snowflake, ruleId: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/auto-moderation/rules': {\n GET: 'listAutoModerationRules',\n POST: 'createAutoModerationRule',\n },\n '/guilds/{guild.id}/auto-moderation/rules/{rule.id}': {\n GET: 'getAutoModerationRule',\n PATCH: 'modifyAutoModerationRule',\n DELETE: 'deleteAutoModerationRule',\n },\n})\n", "import { integer, Internal, snowflake, User } from '.'\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\nexport namespace Ban {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-ban-add-guild-ban-add-event-fields */\n export interface Add {\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-events#guild-ban-remove-guild-ban-remove-event-fields */\n export interface Remove {\n /** id of the guild */\n guild_id: snowflake\n /** the unbanned user */\n user: User\n }\n }\n\n /** @see https://discord.com/developers/docs/resources/guild#get-guild-bans-query-string-params */\n export interface GetParams {\n /** number of users to return (up to maximum 1000) */\n limit?: number\n /** consider only users before given user id */\n before?: snowflake\n /** consider only users after given user id */\n after?: snowflake\n }\n\n /** @see https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params */\n export interface CreateParams {\n /** number of days to delete messages for (0-7) (deprecated) */\n delete_message_days?: integer\n /** number of seconds to delete messages for, between 0 and 604800 (7 days) */\n delete_message_seconds?: integer\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was banned from a guild */\n GUILD_BAN_ADD: Ban.Event.Add\n /** user was unbanned from a guild */\n GUILD_BAN_REMOVE: Ban.Event.Remove\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-bans\n */\n getGuildBans(guild_id: snowflake, params: Ban.GetParams): Promise<Ban[]>\n /**\n * Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-ban\n */\n getGuildBan(guild_id: snowflake, user_id: snowflake): Promise<Ban>\n /**\n * Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Ban Add Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-ban\n */\n createGuildBan(guild_id: snowflake, user_id: snowflake, params?: Ban.CreateParams): Promise<void>\n /**\n * Remove the ban for a user. Requires the BAN_MEMBERS permissions. Returns a 204 empty response on success. Fires a Guild Ban Remove Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-ban\n */\n removeGuildBan(guild_id: snowflake, user_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\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})\n", "import { GuildMember, integer, Internal, snowflake, ThreadMember, ThreadMetadata, 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: Channel.Type\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 /** number of messages (not including the initial message or deleted messages) in a thread. */\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, copied onto newly created threads, in minutes, threads will stop showing in the channel list after the specified period of inactivity, 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 /** channel flags combined as a bitfield */\n flags?: integer\n /** number of messages ever sent in a thread, it's similar to message_count on message creation, but will not decrement the number when a message is deleted */\n total_message_sent?: integer\n /** the set of tags that can be used in a GUILD_FORUM channel */\n available_tags?: ForumTag[]\n /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */\n applied_tags?: snowflake[]\n /** the emoji to show in the add reaction button on a thread in a GUILD_FORUM channel */\n default_reaction_emoji?: DefaultReaction\n /** the initial rate_limit_per_user to set on newly created threads in a channel. this field is copied to the thread at creation time and does not live update. */\n default_thread_rate_limit_per_user?: integer\n /** the default sort order type used to order posts in GUILD_FORUM channels. Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin */\n default_sort_order?: integer\n /** the default forum layout view used to display posts in GUILD_FORUM channels. Defaults to 0, which indicates a layout view has not been set by a channel admin */\n default_forum_layout?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#role-subscription-data-object */\nexport interface RoleSubscriptionData {\n /** the id of the sku and listing that the user is subscribed to */\n role_subscription_listing_id: snowflake\n /** the name of the tier that the user is subscribed to */\n tier_name: string\n /** the cumulative number of months that the user has been subscribed for */\n total_months_subscribed: integer\n /** whether this notification is for a renewal rather than a new purchase */\n is_renewal: boolean\n}\n\nexport namespace Channel {\n /** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */\n export enum Type {\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 /** the channel in a hub containing the listed servers */\n GUILD_DIRECTORY = 14,\n /** Channel that can only contain threads */\n GUILD_FORUM = 15,\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#create-dm-json-params */\n export interface CreateDM {\n /** the recipient to open a DM channel with */\n recipient_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/user#create-group-dm-json-params */\n export interface CreateGroupDM {\n /** access tokens of users that have granted your app the gdm.join scope */\n access_tokens: string[]\n /** a dictionary of user ids to their respective nicknames */\n nicks: Record<string, string>\n }\n\n /** https://discord.com/developers/docs/resources/guild#create-guild-channel-json-params */\n export interface Create {\n /** channel name (1-100 characters) */\n name: string\n /** the type of channel */\n type: integer\n /** channel topic (0-1024 characters) */\n topic: string\n /** the bitrate (in bits) of the voice channel (voice only) */\n bitrate: integer\n /** the user limit of the voice channel (voice only) */\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 /** sorting position of the channel */\n position: integer\n /** the channel's permission overwrites */\n permission_overwrites: Overwrite[]\n /** id of the parent category for a channel */\n parent_id: snowflake\n /** whether the channel is nsfw */\n nsfw: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params */\n export interface ModifyPositions {\n /** channel id */\n 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\n export type Modify =\n | Partial<Modify.GroupDM>\n | Partial<Modify.GuildChannel>\n | Partial<Modify.Thread>\n\n export namespace Modify {\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-group-dm */\n export interface GroupDM {\n /** 1-100 character channel name */\n name: string\n /** base64 encoded icon */\n icon: string\n }\n\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel */\n export interface GuildChannel {\n /** 1-100 character channel name */\n name: string\n /** the type of channel; only conversion between text and news is supported and only in guilds with the \"NEWS\" feature */\n type: integer\n /** the position of the channel in the left-hand listing */\n position?: integer\n /** 0-1024 character channel topic */\n topic?: string\n /** whether the channel is nsfw */\n nsfw?: boolean\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 bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) */\n bitrate?: integer\n /** the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit */\n user_limit?: integer\n /** channel or category-specific permissions */\n permission_overwrites?: Overwrite[]\n /** id of the new parent category for a channel */\n parent_id?: snowflake\n /** channel voice region id, automatic when set to null */\n rtc_region?: string\n /** the camera video quality mode of the voice channel */\n video_quality_mode?: integer\n /** the default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity */\n default_auto_archive_duration?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-thread */\n export interface Thread {\n /** 1-100 character channel name */\n name: string\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 /** 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 /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected */\n rate_limit_per_user?: integer\n }\n }\n\n /** https://discord.com/developers/docs/resources/channel#edit-channel-permissions-json-params */\n export interface EditPermissions {\n /** the bitwise value of all allowed permissions */\n allow: string\n /** the bitwise value of all disallowed permissions */\n deny: string\n /** 0 for a role or 1 for a member */\n type: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#follow-news-channel-json-params */\n export interface Follow {\n /** id of target channel */\n webhook_channel_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient-json-params */\n export interface AddRecipient {\n /** access token of a user that has granted your app the gdm.join scope */\n access_token: string\n /** nickname of the user being added */\n nick: string\n }\n }\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 enum OverwriteType {\n ROLE = 0,\n MEMBER = 1,\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: OverwriteType\n /** permission bit set */\n allow: string\n /** permission bit set */\n deny: string\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-events#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-events#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\n/** https://discord.com/developers/docs/resources/channel#forum-tag-object */\nexport interface ForumTag {\n /** the id of the tag */\n id: snowflake\n /** the name of the tag (0-20 characters) */\n name: string\n /** whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission */\n moderated: boolean\n /** the id of a guild's custom emoji */\n emoji_id?: snowflake\n /** the unicode character of the emoji */\n emoji_name?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#default-reaction-object */\nexport interface DefaultReaction {\n /** the id of a guild's custom emoji */\n emoji_id?: snowflake\n /** the unicode character of the emoji */\n emoji_name?: string\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 /** 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 /**\n * Create a new DM channel with a user. Returns a DM channel object.\n * @see https://discord.com/developers/docs/resources/user#create-dm\n */\n createDM(params: Channel.Params.CreateDM): Promise<Channel>\n /**\n * Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. DMs created with this endpoint will not be shown in the Discord client\n * @see https://discord.com/developers/docs/resources/user#create-group-dm\n */\n createGroupDM(params: Channel.Params.CreateGroupDM): Promise<Channel>\n }\n}\n\nInternal.define({\n '/users/@me/channels': {\n POST: ['createDM', 'createGroupDM'],\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of guild channel objects. Does not include threads.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-channels\n */\n getGuildChannels(guild_id: snowflake): Promise<Channel[]>\n /**\n * Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-channel\n */\n createGuildChannel(guild_id: snowflake, params: Channel.Params.Create): Promise<Channel>\n /**\n * Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Returns a 204 empty response on success. Fires multiple Channel Update Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions\n */\n modifyGuildChannelPositions(guild_id: snowflake, params: Channel.Params.ModifyPositions): 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 /**\n * Get a channel by ID. Returns a channel object. If the channel is a thread, a thread member object is included in the returned result.\n * @see https://discord.com/developers/docs/resources/channel#get-channel\n */\n getChannel(channel_id: snowflake): Promise<Channel>\n /**\n * Update a channel's settings. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. All JSON parameters are optional.\n * @see https://discord.com/developers/docs/resources/channel#modify-channel\n */\n modifyChannel(channel_id: snowflake, params: Channel.Params.Modify): Promise<Channel>\n /**\n * Delete a channel, or close a private message. Requires the MANAGE_CHANNELS permission for the guild, or MANAGE_THREADS if the channel is a thread. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway event (or Thread Delete if the channel was a thread).\n * @see https://discord.com/developers/docs/resources/channel#deleteclose-channel\n */\n deleteChannel(channel_id: snowflake): Promise<Channel>\n /**\n * Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel). Returns a 204 empty response on success. For more information about permissions, see permissions.\n * @see https://discord.com/developers/docs/resources/channel#edit-channel-permissions\n */\n editChannelPermissions(channel_id: snowflake, overwrite_id: string, params: Channel.Params.EditPermissions): Promise<void>\n /**\n * Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. For more information about permissions, see permissions\n * @see https://discord.com/developers/docs/resources/channel#delete-channel-permission\n */\n deleteChannelPermission(channel_id: snowflake, overwrite_id: string): Promise<void>\n /**\n * Follow a News Channel to send messages to a target channel. Requires the MANAGE_WEBHOOKS permission in the target channel. Returns a followed channel object.\n * @see https://discord.com/developers/docs/resources/channel#follow-news-channel\n */\n followNewsChannel(channel_id: snowflake, params: Channel.Params.Follow): Promise<void>\n /**\n * Post a typing indicator for the specified channel. Generally bots should not implement this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a Typing Start Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#trigger-typing-indicator\n */\n triggerTypingIndicator(channel_id: snowflake): Promise<void>\n /**\n * Adds a recipient to a Group DM using their access token.\n * @see https://discord.com/developers/docs/resources/channel#group-dm-add-recipient\n */\n groupDMAddRecipient(channel_id: snowflake, user_id: snowflake, params: Channel.Params.AddRecipient): Promise<void>\n /**\n * Removes a recipient from a Group DM.\n * @see https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient\n */\n groupDMRemoveRecipient(channel_id: snowflake, user_id: snowflake): Promise<void>\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}/followers': {\n POST: 'followNewsChannel',\n },\n '/channels/{channel.id}/typing': {\n POST: 'triggerTypingIndicator',\n },\n '/channels/{channel.id}/recipients/{user.id}': {\n PUT: 'groupDMAddRecipient',\n DELETE: 'groupDMRemoveRecipient',\n },\n})\n", "import { Channel, integer, Internal, Locale, 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?: ApplicationCommand.Type\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 /** Name of command, 1-32 characters */\n name: string\n /** Localization dictionary for name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** Description for `CHAT_INPUT` commands, 1-100 characters. Empty string for `USER` and `MESSAGE` commands */\n description: string\n /** Localization dictionary for description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command, max 25 */\n options?: ApplicationCommand.Option[]\n /** Set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** Indicates whether the command is age-restricted, defaults to false */\n nsfw?: boolean\n /** autoincrementing version identifier updated during substantial record changes */\n version: snowflake\n}\n\nexport namespace ApplicationCommand {\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */\n export enum Type {\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 */\n export interface Option {\n /** the type of option */\n type: OptionType\n /** 1-32 character name */\n name: string\n /** Localization dictionary for the `name` field. Values follow the same restrictions as `name` */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description: string\n /** Localization dictionary for the `description` field. Values follow the same restrictions as `description` */\n description_localizations?: Record<Locale, 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?: OptionChoice[]\n /** if the option is a subcommand or subcommand group type, this nested options will be the parameters */\n options?: Option[]\n /** if the option is a channel type, the channels shown will be restricted to these types */\n channel_types?: Channel.Type[]\n /** if the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. integer for `INTEGER` options, double for `NUMBER` options */\n min_value?: number\n /** if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted. integer for `INTEGER` options, double for `NUMBER` options */\n max_value?: number\n /** For option type `STRING`, the minimum allowed length (minimum of 0, maximum of 6000) */\n min_length?: integer\n /** For option type `STRING`, the minimum allowed length (maximum of 1, maximum of 6000) */\n max_length?: integer\n /** If autocomplete interactions are enabled for this `STRING`, `INTEGER`, or `NUMBER` type option */\n autocomplete?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */\n export enum OptionType {\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 /** attachment object */\n ATTACHMENT = 11,\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */\n export interface OptionChoice {\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 /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */\n export interface GuildPermissions {\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: Permissions[]\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */\n export interface Permissions {\n /**\n * ID of the role, user, or channel.\n * It can also be a [permission constant](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants):\n * - `guild_id`: All members in a guild\n * - `guild_id - 1`: All channels in a guild\n */\n id: snowflake\n /** role or user */\n type: PermissionType\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 */\n export enum PermissionType {\n ROLE = 1,\n USER = 2,\n CHANNEL = 3,\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands-query-string-params */\n export interface Get {\n /** Whether to include full localization dictionaries (name_localizations and description_localizations) in the returned objects, instead of the name_localized and description_localized fields. Default false. */\n with_localizations: boolean\n }\n /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command-json-params */\n export interface Create {\n /** 1-32 character name */\n name: string\n /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description?: string\n /** localization dictionary for the description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command */\n options?: Option[]\n /** set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** the type of command, defaults 1 if not set */\n type?: Type\n /** indicates whether the command is age-restricted */\n nsfw?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */\n export interface Edit {\n /** 1-32 character name */\n name: string\n /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description?: string\n /** localization dictionary for the description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command */\n options?: Option[]\n /** set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** indicates whether the command is age-restricted */\n nsfw?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */\n export interface EditPermissions {\n /** the permissions for the command in the guild */\n permissions: Permissions[]\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /**\n * sent when an application command's permissions are updated\n * @see https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update\n */\n APPLICATION_COMMAND_PERMISSIONS_UPDATE: ApplicationCommand.GuildPermissions\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Fetch all of the global commands for your application. Returns an array of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands\n */\n getGlobalApplicationCommands(application_id: snowflake, param?: ApplicationCommand.Params.Get): Promise<ApplicationCommand[]>\n /**\n * Creating a command with the same name as an existing command for your application will overwrite the old command.\n * @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command\n */\n createGlobalApplicationCommand(application_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>\n /**\n * Takes a list of application commands, overwriting the existing global command list for this application. Updates will be available in all guilds after 1 hour. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits.\n * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands\n */\n bulkOverwriteGlobalApplicationCommands(application_id: snowflake, data: ApplicationCommand.Params.Create[]): Promise<ApplicationCommand[]>\n /**\n * Fetch a global command for your application. Returns an application command object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command\n */\n getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /**\n * All parameters for this endpoint are optional.\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command\n */\n editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>\n /**\n * Deletes a global command. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command\n */\n deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>\n /**\n * Fetch all of the guild commands for your application for a specific guild. Returns an array of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands\n */\n getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>\n /**\n * Creating a command with the same name as an existing command for your application will overwrite the old command.\n * @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command\n */\n createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>\n /**\n * Takes a list of application commands, overwriting the existing command list for this application for the targeted guild. Returns 200 and a list of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands\n */\n bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>\n /**\n * Fetches command permissions for all commands for your application in a guild. Returns an array of guild application command permissions objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions\n */\n getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand.GuildPermissions[]>\n /**\n * Fetch a guild command for your application. Returns an application command object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command\n */\n getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /**\n * All parameters for this endpoint are optional.\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command\n */\n editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>\n /**\n * Delete a guild command. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command\n */\n deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>\n /**\n * Fetches command permissions for a specific command for your application in a guild. Returns a guild application command permissions object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions\n */\n getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand.GuildPermissions>\n /**\n * This endpoint will overwrite existing permissions for the command in that guild\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions\n */\n editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.EditPermissions): Promise<ApplicationCommand.GuildPermissions>\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 },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions': {\n GET: 'getApplicationCommandPermissions',\n PUT: 'editApplicationCommandPermissions',\n },\n})\n", "import { Channel, Emoji, integer } from '.'\n\nexport type Component = Button | SelectMenu | TextInput | ActionRow\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 /** A text input object */\n TEXT_INPUT = 4,\n /** Select menu for users */\n USER_SELECT = 5,\n /** Select menu for roles */\n ROLE_SELECT = 6,\n /** Select menu for mentionables (users and roles) */\n MENTIONABLE_SELECT = 7,\n /** Select menu for channels */\n CHANNEL_SELECT = 8,\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#action-rows */\nexport interface ActionRow {\n type: ComponentType.ACTION_ROW\n components: Component[]\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: ComponentType.BUTTON\n /** one of button styles */\n style: ButtonStyles\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#button-object-button-styles */\nexport const enum ButtonStyles {\n /** blurple */\n PRIMARY = 1,\n /** grey */\n SECONDARY = 2,\n /** green */\n SUCCESS = 3,\n /** red */\n DANGER = 4,\n /** grey, navigates to a URL */\n LINK = 5,\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: ComponentType.SELECT_MENU | ComponentType.USER_SELECT | ComponentType.ROLE_SELECT | ComponentType.MENTIONABLE_SELECT | ComponentType.CHANNEL_SELECT\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 /** list of channel types to include in the channel select component (type 8) */\n channel_types?: Channel.Type[]\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\n/** @see https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure */\nexport interface TextInput {\n /** 4 for a text input */\n type: ComponentType.TEXT_INPUT\n /** a developer-defined identifier for the input, max 100 characters */\n custom_id: string\n /** the Text Input Style */\n style: TextInputStyles\n /** the label for this component, max 45 characters */\n label: string\n /** the minimum input length for a text input, min 0, max 4000 */\n min_length?: integer\n /** the maximum input length for a text input, min 1, max 4000 */\n max_length?: integer\n /** whether this component is required to be filled, default true */\n required?: boolean\n /** a pre-filled value for this component, max 4000 characters */\n value?: string\n /** custom placeholder text if the input is empty, max 100 characters */\n placeholder?: string\n}\n\n/** @see https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles */\nexport const enum TextInputStyles {\n /** A single-line input */\n SHORT = 1,\n /** A multi-line input */\n PARAGRAPH = 2,\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 { 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\nexport namespace Emoji {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update-guild-emojis-update-event-fields */\n export interface Update {\n /** id of the guild */\n guild_id: snowflake\n /** array of emojis */\n emojis: Emoji[]\n }\n }\n\n /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params */\n export interface CreateParams extends ModifyParams {\n /** the 128x128 emoji image */\n image: string\n }\n\n /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji-json-params */\n export interface ModifyParams {\n /** name of the emoji */\n name?: string\n /** array of snowflakes roles allowed to use this emoji */\n roles?: snowflake[]\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild emojis were updated */\n GUILD_EMOJIS_UPDATE: Emoji.Event.Update\n }\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: Emoji.CreateParams): Promise<Emoji>\n /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */\n modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: Emoji.ModifyParams): 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", "import { Activity, integer, Internal, snowflake, StatusType } from '.'\n\nexport namespace Gateway {\n /** https://discord.com/developers/docs/topics/gateway-events#payload-structure */\n export interface PayloadStructure<O extends Opcode, 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\n export type Payload = {\n [O in Opcode]: O extends Opcode.DISPATCH\n ? {\n [T in keyof GatewayEvents]: PayloadStructure<Opcode.DISPATCH, T, GatewayEvents[T]>\n }[keyof GatewayEvents]\n : PayloadStructure<O, never, O extends keyof Params ? Params[O] : never>\n }[Opcode]\n\n /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */\n export enum Opcode {\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 */\n export enum Intent {\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 GUILDS = 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 * `MESSAGE_CONTENT` is a unique privileged intent that isn't directly associated with any Gateway events.\n * Instead, access to `MESSAGE_CONTENT` permits your app to receive message content data across the APIs.\n *\n * Any fields affected by the message content intent are noted in the relevant documentation.\n * For example, the content, embeds, attachments, and components fields in message objects all contain message content and therefore require the intent.\n *\n * Like other privileged intents, `MESSAGE_CONTENT` must be approved for your app.\n * After your app is verified, you can apply for the intent from your app's settings within the Developer Portal.\n * You can read more about the message content intent review policy in the [Help Center](https://support-dev.discord.com/hc/en-us/articles/5324827539479).\n *\n * Apps without the intent will receive empty values in fields that contain user-inputted content with a few exceptions:\n * - Content in messages that an app sends\n * - Content in DMs with the app\n * - Content in which the app is mentioned\n *\n * @see https://discord.com/developers/docs/topics/gateway#message-content-intent\n */\n MESSAGE_CONTENT = 1 << 15,\n /**\n * - GUILD_SCHEDULED_EVENT_CREATE\n * - GUILD_SCHEDULED_EVENT_UPDATE\n * - GUILD_SCHEDULED_EVENT_DELETE\n * - GUILD_SCHEDULED_EVENT_USER_ADD\n * - GUILD_SCHEDULED_EVENT_USER_REMOVE\n */\n GUILD_SCHEDULED_EVENTS = 1 << 16,\n /**\n * - AUTO_MODERATION_RULE_CREATE\n * - AUTO_MODERATION_RULE_UPDATE\n * - AUTO_MODERATION_RULE_DELETE\n */\n AUTO_MODERATION_CONFIGURATION = 1 << 20,\n /**\n * - AUTO_MODERATION_ACTION_EXECUTION\n */\n AUTO_MODERATION_EXECUTION = 1 << 21,\n }\n\n export interface Params {\n [Opcode.HELLO]: Params.Hello\n [Opcode.IDENTIFY]: Params.Identify\n [Opcode.RESUME]: Params.Resume\n [Opcode.REQUEST_GUILD_MEMBERS]: Params.RequestGuildMembers\n [Opcode.VOICE_STATE_UPDATE]: Params.VoiceStateUpdate\n [Opcode.PRESENCE_UPDATE]: Params.PresenceUpdate\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure */\n export interface Hello {\n /** the interval (in milliseconds) the client should heartbeat with */\n heartbeat_interval: integer\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure */\n export interface Identify {\n /** authentication token */\n token: string\n /** connection properties */\n properties: ConnectionProperties\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?: PresenceUpdate\n /** the Gateway Intents you wish to receive */\n intents: integer\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties */\n export interface ConnectionProperties {\n /** Your operating system */\n os: string\n /** Your library name */\n browser: string\n /** Your library name */\n device: string\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure */\n export interface Resume {\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-events#request-guild-members-guild-request-members-structure */\n export interface RequestGuildMembers {\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-events#update-voice-state-gateway-voice-state-update-structure */\n export interface VoiceStateUpdate {\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-events#update-presence-gateway-presence-update-structure */\n export interface PresenceUpdate {\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}\n\n/** https://discord.com/developers/docs/topics/gateway-events#gateway-events */\nexport interface GatewayEvents {}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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\n/** https://discord.com/developers/docs/topics/gateway#get-gateway-example-response */\nexport interface GetGatewayResponse {\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot-json-response */\nexport interface GetGatewayBotResponse extends GetGatewayResponse {\n shards: integer\n session_start_limit: SessionStartLimit\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.\n * @see https://discord.com/developers/docs/topics/gateway#get-gateway\n */\n getGateway(): Promise<GetGatewayResponse>\n /**\n * Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike the Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds.\n * @see https://discord.com/developers/docs/topics/gateway#get-gateway-bot\n */\n getGatewayBot(): Promise<GetGatewayBotResponse>\n }\n}\n\nInternal.define({\n '/gateway': {\n GET: 'getGateway',\n },\n '/gateway/bot': {\n GET: 'getGatewayBot',\n },\n})\n", "import { Gateway, integer, Internal, 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 /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */\n communication_disabled_until?: timestamp\n}\n\nexport namespace GuildMember {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#list-guild-members-query-string-params */\n export interface List {\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\n /** https://discord.com/developers/docs/resources/guild#search-guild-members-query-string-params */\n export interface Search {\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\n /** https://discord.com/developers/docs/resources/guild#add-guild-member-json-params */\n export interface Add {\n /** an oauth2 access token granted with the guilds.join to the bot's application for the user you want to add to the guild */\n access_token: string\n /** value to set user's nickname to */\n nick: string\n /** array of role ids the member is assigned */\n roles: snowflake[]\n /** whether the user is muted in voice channels */\n mute: boolean\n /** whether the user is deafened in voice channels */\n deaf: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-member-json-params */\n export interface Modify {\n /** value to set user's nickname to */\n nick: string\n /** array of role ids the member is assigned */\n roles: snowflake[]\n /** whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel */\n mute: boolean\n /** whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel */\n deaf: boolean\n /** id of channel to move user to (if they are connected to voice) */\n channel_id: snowflake\n /** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout */\n communication_disabled_until?: timestamp\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-current-member-json-params */\n export interface ModifyCurrent {\n /** value to set user's nickname to */\n nick?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params */\n export interface GetPruneCount {\n /** number of days to count prune for (1-30) */\n days: integer\n /** role(s) to include */\n include_roles: string\n }\n\n /** https://discord.com/developers/docs/resources/guild#begin-guild-prune-json-params */\n export interface BeginPrune {\n /** number of days to prune (1-30) */\n days: integer\n /** whether 'pruned' is returned, discouraged for large guilds */\n compute_prune_count: boolean\n /** role(s) to include */\n include_roles: snowflake[]\n }\n }\n\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-member-add-guild-member-add-extra-fields */\n export interface Add extends GuildMember {\n /** id of the guild */\n guild_id: snowflake\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#guild-member-remove-guild-member-remove-event-fields */\n export interface Remove {\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-events#guild-member-update-guild-member-update-event-fields */\n export interface Update {\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 /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */\n communication_disabled_until?: timestamp\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk-guild-members-chunk-event-fields */\n export interface Chunk {\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?: Gateway.Params.PresenceUpdate[]\n /** the nonce used in the Guild Members Request */\n nonce?: string\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new user joined a guild */\n GUILD_MEMBER_ADD: GuildMember.Event.Add\n /** user was removed from a guild */\n GUILD_MEMBER_REMOVE: GuildMember.Event.Remove\n /** guild member was updated */\n GUILD_MEMBER_UPDATE: GuildMember.Event.Update\n /** response to Request Guild Members */\n GUILD_MEMBERS_CHUNK: GuildMember.Event.Chunk\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a guild member object for the specified user.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-member\n */\n getGuildMember(guild_id: snowflake, user_id: snowflake): Promise<GuildMember>\n /**\n * Returns a list of guild member objects that are members of the guild.\n * @see https://discord.com/developers/docs/resources/guild#list-guild-members\n */\n listGuildMembers(guild_id: snowflake, params?: GuildMember.Params.List): Promise<GuildMember[]>\n /**\n * Returns a list of guild member objects whose username or nickname starts with a provided string.\n * @see https://discord.com/developers/docs/resources/guild#search-guild-members\n */\n searchGuildMembers(guild_id: snowflake, params?: GuildMember.Params.Search): Promise<GuildMember[]>\n /**\n * Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member of the guild. Fires a Guild Member Add Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#add-guild-member\n */\n addGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Add): Promise<void>\n /**\n * Modify attributes of a guild member. Returns a 200 OK with the guild member as the body. Fires a Guild Member Update Gateway event. If the channel_id is set to null, this will force the target user to be disconnected from voice.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-member\n */\n modifyGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Modify): Promise<void>\n /**\n * Modifies the current member in a guild. Returns a 200 with the updated member object on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-current-member\n */\n modifyCurrentMember(guild_id: snowflake, params: GuildMember.Params.ModifyCurrent): Promise<void>\n /**\n * Adds a role to a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#add-guild-member-role\n */\n addGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>\n /**\n * Removes a role from a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-member-role\n */\n removeGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>\n /**\n * Remove a member from a guild. Requires KICK_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Member Remove Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-member\n */\n removeGuildMember(guild_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count\n */\n getGuildPruneCount(guild_id: snowflake, params?: GuildMember.Params.GetPruneCount): Promise<void>\n /**\n * Begin a prune operation. Requires the KICK_MEMBERS permission. Returns an object with one 'pruned' key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to null. Fires multiple Guild Member Remove Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#begin-guild-prune\n */\n beginGuildPrune(guild_id: snowflake, params: GuildMember.Params.BeginPrune): Promise<void>\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/{user.id}/roles/{role.id}': {\n PUT: 'addGuildMemberRole',\n DELETE: 'removeGuildMemberRole',\n },\n '/guilds/{guild.id}/prune': {\n GET: 'getGuildPruneCount',\n POST: 'beginGuildPrune',\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\nexport namespace GuildTemplate {\n /** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template-json-params */\n export interface CreateGuildParams {\n /** name of the guild (2-100 characters) */\n name: string\n /** base64 128x128 image for the guild icon */\n icon?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-template#create-guild-template-json-params */\n export interface CreateParams {\n /** name of the template (1-100 characters) */\n name: string\n /** description for the template (0-120 characters) */\n description?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-template#modify-guild-template-json-params */\n export interface ModifyParams {\n /** name of the template (1-100 characters) */\n name?: string\n /** description for the template (0-120 characters) */\n description?: string\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a guild template object for the given code.\n * @see https://discord.com/developers/docs/resources/guild-template#get-guild-template\n */\n getGuildTemplate(code: string): Promise<GuildTemplate>\n /**\n * Create a new guild based on a template. Returns a guild object on success. Fires a Guild Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template\n */\n createGuildfromGuildTemplate(code: string, params: GuildTemplate.CreateGuildParams): Promise<Guild>\n /**\n * Returns an array of guild template objects. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild-template#get-guild-templates\n */\n getGuildTemplates(guild_id: snowflake): Promise<GuildTemplate[]>\n /**\n * Creates a template for the guild. Requires the MANAGE_GUILD permission. Returns the created guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#create-guild-template\n */\n createGuildTemplate(guild_id: snowflake, params: GuildTemplate.CreateParams): Promise<GuildTemplate>\n /**\n * Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#sync-guild-template\n */\n syncGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>\n /**\n * Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#modify-guild-template\n */\n modifyGuildTemplate(guild_id: snowflake, code: string, params: GuildTemplate.ModifyParams): Promise<GuildTemplate>\n /**\n * Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#delete-guild-template\n */\n deleteGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>\n }\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, Role, snowflake, Sticker, User } 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 /** 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 /** custom guild stickers */\n stickers?: Sticker[]\n /** whether the guild has the boost progress bar enabled */\n premium_progress_bar_enabled: boolean\n}\n\nexport namespace Guild {\n export namespace Event {\n export interface Create extends Guild {}\n\n export interface Update extends Guild {}\n\n export interface Delete extends Guild {}\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#get-current-user-guilds-query-string-params */\n export interface List {\n /** get guilds before this guild ID */\n before?: snowflake\n /** get guilds after this guild ID */\n after?: snowflake\n /** max number of guilds to return (1-200) */\n limit?: integer\n /** include approximate member and presence counts in response */\n with_counts?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#create-guild-json-params */\n export interface Create {\n /** name of the guild (2-100 characters) */\n name: string\n /** voice region id (deprecated) */\n region?: string\n /** base64 128x128 image for the guild icon */\n icon?: string\n /** verification level */\n verification_level?: integer\n /** default message notification level */\n default_message_notifications?: integer\n /** explicit content filter level */\n explicit_content_filter?: integer\n /** new guild roles */\n roles?: Role[]\n /** new guild's channels */\n channels?: Partial<Channel>[]\n /** id for afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout?: integer\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 }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-query-string-params */\n export interface Get {\n /** when true, will return approximate member and presence counts for the guild */\n with_counts?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-json-params */\n export interface Modify {\n /** guild name */\n name: string\n /** guild voice region id (deprecated) */\n region?: string\n /** verification level */\n verification_level?: integer\n /** default message notification level */\n default_message_notifications?: integer\n /** explicit content filter level */\n explicit_content_filter?: integer\n /** id for afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout: integer\n /** base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) */\n icon?: string\n /** user id to transfer guild ownership to (must be owner) */\n owner_id: snowflake\n /** base64 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) */\n splash?: string\n /** base64 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) */\n discovery_splash?: string\n /** base64 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature) */\n banner?: string\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 display rules and/or guidelines */\n rules_channel_id?: snowflake\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 preferred locale of a Community guild used in server discovery and notices from Discord; defaults to \"en-US\" */\n preferred_locale?: string\n /** enabled guild features */\n features: GuildFeature[]\n /** the description for the guild, if the guild is discoverable */\n description?: string\n /** whether the guild's boost progress bar should be enabled. */\n premium_progress_bar_enabled: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */\n export interface GetWidgetImage {\n /** style of the widget image returned (see below) */\n style: WidgetStyleOptions\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options */\n export enum WidgetStyleOptions {\n /** shield style widget with Discord icon and guild members online count */\n shield = 'shield',\n /** large image with guild icon, name and online count. \"POWERED BY DISCORD\" as the footer of the widget */\n banner1 = 'banner1',\n /** smaller widget style with guild icon, name and online count. Split on the right with Discord logo */\n banner2 = 'banner2',\n /** large image with guild icon, name and online count. In the footer, Discord logo on the left and \"Chat Now\" on the right */\n banner3 = 'banner3',\n /** large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget and a \"JOIN MY SERVER\" button at the bottom */\n banner4 = 'banner4',\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen-json-params */\n export interface ModifyWelcomeScreen {\n /** whether the welcome screen is enabled */\n enabled: boolean\n /** channels linked in the welcome screen and their display options */\n welcome_channels: WelcomeScreenChannel[]\n /** the server description to show in the welcome screen */\n description: string\n }\n }\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 /** Hide member join sticker reply buttons */\n SUPPRESS_JOIN_NOTIFICATION_REPLIES = 1 << 3,\n /** Suppress role subscription purchase and renewal notifications */\n SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS = 1 << 4,\n /** Hide role subscription sticker reply buttons */\n SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES = 1 << 5\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 /** custom guild stickers */\n stickers: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */\nexport interface GuildWidget {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters) */\n name: string\n /** instant invite for the guilds specified widget invite channel */\n instant_invite?: string\n /** voice and stage channels which are accessible by everyone */\n channels: Partial<Channel>[]\n /** special widget user objects that includes users presence (Limit 100) */\n members: Partial<User>[]\n /** number of online members in this guild */\n presence_count: integer\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\ndeclare module './gateway' {\n interface GatewayEvents {\n /** lazy-load for unavailable guild, guild became available, or user joined a new guild */\n GUILD_CREATE: Guild.Event.Create\n /** guild was updated */\n GUILD_UPDATE: Guild.Event.Update\n /** guild became unavailable, or user left/was removed from a guild */\n GUILD_DELETE: Guild.Event.Delete\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-current-user-guilds\n */\n getCurrentUserGuilds(params?: Guild.Params.List): Promise<Guild[]>\n /**\n * Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-current-user-guild-member\n */\n getCurrentUserGuildMember(guild_id: snowflake): Promise<GuildMember>\n /**\n * Leave a guild. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/user#leave-guild\n */\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}/member': {\n GET: 'getCurrentUserGuildMember',\n },\n '/users/@me/guilds/{guild.id}': {\n DELETE: 'leaveGuild',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild\n */\n createGuild(params: Guild.Params.Create): Promise<Guild>\n /**\n * Returns the guild object for the given id. If with_counts is set to true, this endpoint will also return approximate_member_count and approximate_presence_count for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild\n */\n getGuild(guild_id: snowflake, params?: Guild.Params.Get): Promise<Guild>\n /**\n * Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-preview\n */\n getGuildPreview(guild_id: snowflake): Promise<GuildPreview>\n /**\n * Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild\n */\n modifyGuild(guild_id: snowflake, params: Guild.Params.Modify): Promise<void>\n /**\n * Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild\n */\n deleteGuild(guild_id: snowflake): Promise<void>\n /**\n * Returns a guild widget object. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget-settings\n */\n getGuildWidgetSettings(guild_id: snowflake): Promise<GuildWidget>\n /**\n * Modify a guild widget object for the guild. All attributes may be passed in with JSON and modified. Requires the MANAGE_GUILD permission. Returns the updated guild widget object.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-widget\n */\n modifyGuildWidget(guild_id: snowflake, params: Partial<GuildWidget>): Promise<GuildWidget>\n /**\n * Returns the widget for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget\n */\n getGuildWidget(guild_id: snowflake): Promise<any>\n /**\n * Returns a PNG image widget for the guild. Requires no permissions or authentication.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget-image\n */\n getGuildWidgetImage(guild_id: snowflake, params?: Guild.Params.GetWidgetImage): Promise<any>\n /**\n * Returns the Welcome Screen object for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen\n */\n getGuildWelcomeScreen(guild_id: snowflake): Promise<WelcomeScreen>\n /**\n * Modify the guild's Welcome Screen. Requires the MANAGE_GUILD permission. Returns the updated Welcome Screen object.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen\n */\n modifyGuildWelcomeScreen(guild_id: snowflake, params: Guild.Params.ModifyWelcomeScreen): Promise<WelcomeScreen>\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}/widget': {\n GET: 'getGuildWidgetSettings',\n PATCH: 'modifyGuildWidget',\n },\n '/guilds/{guild.id}/widget.json': {\n GET: 'getGuildWidget',\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})\n", "import { integer, Internal, 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 /** the scopes the application has been authorized for */\n scopes?: string[]\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 bot associated with this application */\n bot?: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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-events#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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of integration objects for the guild. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-integrations\n */\n getGuildIntegrations(guild_id: snowflake): Promise<Integration[]>\n /**\n * Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild-integration\n */\n deleteGuildIntegration(guild_id: snowflake, integration_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/integrations': {\n GET: 'getGuildIntegrations',\n },\n '/guilds/{guild.id}/integrations/{integration.id}': {\n DELETE: 'deleteGuildIntegration',\n },\n})\n", "import { AllowedMentions, ApplicationCommand, Attachment, Channel, Component, ComponentType, Embed, GuildMember, integer, Internal, Message, Role, snowflake, User } from '.'\nimport * as Discord 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: Interaction.Type\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 /** bitwise set of permissions the app or bot has within the channel the interaction was sent from */\n app_permissions?: string\n /** selected language of the invoking user */\n locale?: string\n /** guild's preferred locale, if invoked in a guild */\n guild_locale?: string\n}\n\nexport type InteractionData =\n | InteractionData.ApplicationCommand\n | InteractionData.MessageComponent\n | InteractionData.ModalSubmit\n\nexport namespace InteractionData {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */\n export interface ApplicationCommand {\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?: ApplicationCommand.Option[]\n /** the id of the guild the command is registered to */\n guild_id?: snowflake\n /** id of the user or message targeted by a user or message command */\n target_id?: snowflake\n }\n\n export namespace ApplicationCommand {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-interaction-data-option-structure */\n export interface Option {\n /** the name of the parameter */\n name: string\n /** value of application command option type */\n type: Discord.ApplicationCommand.OptionType\n /** the value of the pair */\n value?: any\n /** present if this option is a group or subcommand */\n options?: Option[]\n /** true if this option is the currently focused option for autocomplete */\n focused?: boolean\n }\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-message-component-data-structure */\n export interface MessageComponent {\n /** the custom_id of the component */\n custom_id: string\n /** the type of the component */\n component_type: ComponentType\n /** values the user selected in a select menu component */\n values?: string[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */\n export interface ModalSubmit {\n custom_id: string\n components: Component[]\n }\n}\n\nexport namespace Interaction {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type */\n export enum Type {\n PING = 1,\n APPLICATION_COMMAND = 2,\n MESSAGE_COMPONENT = 3,\n APPLICATION_COMMAND_AUTOCOMPLETE = 4,\n MODAL_SUBMIT = 5,\n }\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 /** the ids and attachment objects */\n attachments?: Record<snowflake, Attachment>\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: Interaction.Type\n /** the name of the application command */\n name: string\n /** the user who invoked the interaction */\n user: User\n /** member who invoked the interaction in the guild */\n member?: Partial<GuildMember>\n}\n\nexport namespace Interaction {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */\n export interface Response {\n /** the type of response */\n type: CallbackType\n /** an optional response message */\n data?: CallbackData\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */\n export enum CallbackType {\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 /**\n * for components, ACK an interaction and edit the original message later; the user does not see a loading state\n * (only valid for [component-based](https://discord.com/developers/docs/interactions/message-components) interactions)\n */\n DEFERRED_UPDATE_MESSAGE = 6,\n /**\n * for components, edit the message the component was attached to\n * (only valid for [component-based](https://discord.com/developers/docs/interactions/message-components) interactions)\n */\n UPDATE_MESSAGE = 7,\n /** respond to an autocomplete interaction with suggested choices */\n APPLICATION_COMMAND_AUTOCOMPLETE_RESULT = 8,\n /**\n * respond to an interaction with a popup modal\n * (not available for `MODAL_SUBMIT` and `PING` interactions)\n */\n MODAL = 9,\n }\n\n export type CallbackData =\n | CallbackData.Messages\n | CallbackData.Autocomplete\n | CallbackData.Modal\n\n export namespace CallbackData {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages */\n export interface Messages {\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 /** attachment objects with filename and description */\n attachments?: Partial<Attachment>[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-autocomplete */\n export interface Autocomplete {\n /** autocomplete choices (max of 25 choices) */\n choices: ApplicationCommand.OptionChoice[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal */\n export interface Modal {\n /** a developer-defined identifier for the modal, max 100 characters */\n custom_id: string\n /** the title of the popup modal, max 45 characters */\n title: string\n /** between 1 and 5 (inclusive) components that make up the modal */\n components: Component[]\n }\n }\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\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a response to an Interaction from the gateway. Takes an interaction response. This endpoint also supports file attachments similar to the webhook endpoints. Refer to Uploading Files for details on uploading files and multipart/form-data requests.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response\n */\n createInteractionResponse(interaction_id: snowflake, token: string, params: Interaction.Response): Promise<void>\n /**\n * Returns the initial Interaction response. Functions the same as Get Webhook Message.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response\n */\n getOriginalInteractionResponse(application_id: snowflake, token: string): Promise<Interaction.Response>\n /**\n * Edits the initial Interaction response. Functions the same as Edit Webhook Message.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response\n */\n editOriginalInteractionResponse(application_id: snowflake, token: string): Promise<Interaction.Response>\n /**\n * Deletes the initial Interaction response. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response\n */\n deleteOriginalInteractionResponse(application_id: snowflake, token: string): Promise<void>\n /**\n * Create a followup message for an Interaction. Functions the same as Execute Webhook, but wait is always true, and flags can be set to 64 in the body to send an ephemeral message. The thread_id, avatar_url, and username parameters are not supported when using this endpoint for interaction followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message\n */\n createFollowupMessage(application_id: snowflake, token: string): Promise<any>\n /**\n * Returns a followup message for an Interaction. Functions the same as Get Webhook Message. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message\n */\n getFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<any>\n /**\n * Edits a followup message for an Interaction. Functions the same as Edit Webhook Message. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message\n */\n editFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<any>\n /**\n * Deletes a followup message for an Interaction. Returns 204 No Content on success. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message\n */\n deleteFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<void>\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, GuildScheduledEvent, 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?: Invite.TargetType\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?: Invite.StageInstance\n /** guild scheduled event data, only included if guild_scheduled_event_id contains a valid guild scheduled event id */\n guild_scheduled_event?: GuildScheduledEvent\n}\n\nexport namespace Invite {\n /** https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */\n export enum TargetType {\n STREAM = 1,\n EMBEDDED_APPLICATION = 2,\n }\n\n /** https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure */\n export interface Metadata extends Invite {\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 */\n export interface StageInstance {\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 export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#invite-create-invite-create-event-fields */\n export interface Create {\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-events#invite-delete-invite-delete-event-fields */\n export interface Delete {\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 }\n\n /** https://discord.com/developers/docs/resources/invite#get-invite-query-string-params */\n export interface GetOptions {\n /** whether to include invite metadata */\n with_counts?: boolean\n /** whether to include invite expiration date */\n with_expiration?: boolean\n /** the guild scheduled event to include with the invite */\n guild_scheduled_event_id?: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params */\n export interface CreateParams {\n /** duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days) */\n max_age: integer\n /** max number of uses or 0 for unlimited. between 0 and 100 */\n max_uses: integer\n /** whether this invite only grants temporary membership */\n temporary: boolean\n /** if true, don't try to reuse a similar invite (useful for creating many unique one time use invites) */\n unique: boolean\n /** the type of target for this voice channel invite */\n target_type: integer\n /** the id of the user whose stream to display for this invite, required if target_type is 1, the user must be streaming in the channel */\n target_user_id: snowflake\n /** the id of the embedded application to open for this invite, required if target_type is 2, the application must have the EMBEDDED flag */\n target_application_id: snowflake\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** invite to a channel was created */\n INVITE_CREATE: Invite.Event.Create\n /** invite to a channel was deleted */\n INVITE_DELETE: Invite.Event.Delete\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an invite object for the given code.\n * @see https://discord.com/developers/docs/resources/invite#get-invite\n */\n getInvite(code: string, params?: Invite.GetOptions): Promise<Invite>\n /**\n * Delete an invite. Requires the MANAGE_CHANNELS permission on the channel this invite belongs to, or MANAGE_GUILD to remove any invite across the guild. Returns an invite object on success. Fires a Invite Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/invite#delete-invite\n */\n deleteInvite(code: string): Promise<Invite>\n /**\n * Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-invites\n */\n getGuildInvites(guild_id: snowflake): Promise<Invite.Metadata[]>\n /**\n * Returns a partial invite object for guilds with that feature enabled. Requires the MANAGE_GUILD permission. code will be null if a vanity url for the guild is not set.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-vanity-url\n */\n getGuildVanityURL(guild_id: snowflake): Promise<Partial<Invite>>\n /**\n * Returns a list of invite objects (with invite metadata) for the channel. Only usable for guild channels. Requires the MANAGE_CHANNELS permission.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-invites\n */\n getChannelInvites(channel_id: string): Promise<Invite.Metadata[]>\n /**\n * Create a new invite object for the channel. Only usable for guild channels. Requires the CREATE_INSTANT_INVITE permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object ({}). Returns an invite object. Fires an Invite Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#create-channel-invite\n */\n createChannelInvite(channel_id: string, params: Invite.CreateParams): Promise<void>\n }\n}\n\nInternal.define({\n '/invites/{invite.code}': {\n GET: 'getInvite',\n DELETE: 'deleteInvite',\n },\n '/guilds/{guild.id}/invites': {\n GET: 'getGuildInvites',\n },\n '/guilds/{guild.id}/vanity-url': {\n GET: 'getGuildVanityURL',\n },\n '/channels/{channel.id}/invites': {\n GET: 'getChannelInvites',\n POST: 'createChannelInvite',\n },\n})\n", "import { AllowedMentions, Application, Channel, Component, GuildMember, integer, Internal, MessageInteraction, Reaction, RoleSubscriptionData, snowflake, Sticker, 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 /** 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: Message.Type\n /** sent with Rich Presence-related chat embeds */\n activity?: Message.Activity\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?: Message.Reference\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?: Sticker.Item[]\n /** a generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with total_message_sent on parent thread */\n position?: integer\n /** data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message */\n role_subscription_data?: RoleSubscriptionData\n}\n\nexport namespace Message {\n /** https://discord.com/developers/docs/resources/channel#message-object-message-types */\n export enum Type {\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 AUTO_MODERATION_ACTION = 24,\n ROLE_SUBSCRIPTION_PURCHASE = 25,\n INTERACTION_PREMIUM_UPSELL = 26,\n GUILD_APPLICATION_PREMIUM_SUBSCRIPTION = 32,\n }\n\n /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */\n export interface Activity {\n /** type of message activity */\n type: ActivityType\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 */\n export enum ActivityType {\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 */\n export enum Flag {\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 /** this message failed to mention some roles and add their members to the thread */\n FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8,\n }\n\n /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */\n export interface Reference {\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#get-channel-messages-query-string-params */\n export interface GetParams {\n /** get messages around this message ID */\n around?: snowflake\n /** get messages before this message ID */\n before?: snowflake\n /** get messages after this message ID */\n after?: snowflake\n /** max number of messages to return (1-100) */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#create-message-jsonform-params */\n export interface CreateParams extends EditParams {\n /** true if this is a TTS message */\n tts: boolean\n /** include to make your message a reply */\n message_reference: Reference\n /** IDs of up to 3 stickers in the server to send in the message */\n sticker_ids: snowflake[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#edit-message-jsonform-params */\n export interface EditParams {\n /** the message contents (up to 2000 characters) */\n content?: string\n /** embedded rich content (up to 6000 characters) */\n embeds?: Embed[]\n /** edit the flags of a message (only SUPPRESS_EMBEDS can currently be set/unset) */\n flags?: integer\n /** allowed mentions for the message */\n allowed_mentions?: AllowedMentions\n /** the components to include with the message */\n components?: Component[]\n /** the contents of the file being sent/edited */\n files?: any\n /** JSON encoded body of non-file params (multipart/form-data only) */\n payload_json?: string\n /** attached files to keep and possible descriptions for new files */\n attachments?: Attachment[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#bulk-delete-messages-json-params */\n export interface BulkDeleteParams {\n /** an array of message ids to delete (2-100) */\n messages: snowflake[]\n }\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?: Embed.Footer\n /** image information */\n image?: Embed.Image\n /** thumbnail information */\n thumbnail?: Embed.Thumbnail\n /** video information */\n video?: Embed.Video\n /** provider information */\n provider?: Embed.Provider\n /** author information */\n author?: Embed.Author\n /** fields information */\n fields?: Embed.Field[]\n}\n\nexport namespace Embed {\n /** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */\n export interface Thumbnail {\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 */\n export interface Video {\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 */\n export interface Image {\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 */\n export interface Provider {\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 */\n export interface Author {\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 */\n export interface Footer {\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 */\n export interface Field {\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\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: Channel.Type\n /** the name of the channel */\n name: string\n}\n\nexport namespace Message {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#message-create */\n export interface Create extends Message {\n /** ID of the guild the message was sent in - unless it is an ephemeral message */\n guild_id?: snowflake\n /** Member properties for this message's author. Missing for ephemeral messages and messages from webhooks */\n member?: Partial<GuildMember>\n /** Users specifically mentioned in the message */\n mentions: (User & { member: Partial<GuildMember> })[]\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#message-update */\n export interface Update extends Partial<Message> {}\n\n /** https://discord.com/developers/docs/topics/gateway-events#message-delete-message-delete */\n export interface Delete {\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-events#message-delete-bulk-message-delete-bulk */\n export interface DeleteBulk {\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 }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** message was created */\n MESSAGE_CREATE: Message.Event.Create\n /** message was edited */\n MESSAGE_UPDATE: Message.Event.Update\n /** message was deleted */\n MESSAGE_DELETE: Message.Event.Delete\n /** multiple messages were deleted at once */\n MESSAGE_DELETE_BULK: Message.Event.DeleteBulk\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the messages for a channel. If operating on a guild channel, this endpoint requires the VIEW_CHANNEL permission to be present on the current user. If the current user is missing the 'READ_MESSAGE_HISTORY' permission in the channel then this will return no messages (since they cannot read the message history). Returns an array of message objects on success.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-messages\n */\n getChannelMessages(channel_id: snowflake, params?: Message.GetParams): Promise<Message[]>\n /**\n * Returns a specific message in the channel. If operating on a guild channel, this endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-message\n */\n getChannelMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /**\n * Post a message to a guild text or DM channel. Returns a message object. Fires a Message Create Gateway event. See message formatting for more information on how to properly format messages.\n * @see https://discord.com/developers/docs/resources/channel#create-message\n */\n createMessage(channel_id: snowflake, params: Message.CreateParams): Promise<Message>\n /**\n * Crosspost a message in a News Channel to following channels. This endpoint requires the 'SEND_MESSAGES' permission, if the current user sent the message, or additionally the 'MANAGE_MESSAGES' permission, for all other messages, to be present for the current user.\n * @see https://discord.com/developers/docs/resources/channel#crosspost-message\n */\n crosspostMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /**\n * Edit a previously sent message. The fields content, embeds, and flags can be edited by the original message author. Other users can only edit flags and only if they have the MANAGE_MESSAGES permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only flags documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).\n * @see https://discord.com/developers/docs/resources/channel#edit-message\n */\n editMessage(channel_id: snowflake, message_id: snowflake, params: Message.EditParams): Promise<Message>\n /**\n * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#delete-message\n */\n deleteMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Bulk Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#bulk-delete-messages\n */\n bulkDeleteMessages(channel_id: snowflake, params: Message.BulkDeleteParams): Promise<void>\n /**\n * Returns all pinned messages in the channel as an array of message objects.\n * @see https://discord.com/developers/docs/resources/channel#get-pinned-messages\n */\n getPinnedMessages(channel_id: snowflake): Promise<Message[]>\n /**\n * Pin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/channel#pin-message\n */\n pinMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Unpin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/channel#unpin-message\n */\n unpinMessage(channel_id: snowflake, message_id: 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 '/channels/{channel.id}/pins': {\n GET: 'getPinnedMessages',\n },\n '/channels/{channel.id}/pins/{message.id}': {\n PUT: 'pinMessage',\n DELETE: 'unpinMessage',\n },\n})\n", "import { Emoji, integer, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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 /** Offline */\n OFFLINE = 'OFFLINE',\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#activity-object-activity-structure */\nexport interface Activity {\n /** the activity's name */\n name: string\n /** activity type */\n type: ActivityType\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-events#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-events#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-events#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-events#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-events#activity-object-activity-secrets */\nexport interface ActivitySecrets {\n /** Secret for joining a party */\n join?: string\n /** Secret for spectating a game */\n spectate?: string\n /** Secret for a specific instanced match */\n match?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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 PARTY_PRIVACY_FRIENDS = 1 << 6,\n PARTY_PRIVACY_VOICE_CHANNEL= 1 << 7,\n EMBEDDED = 1 << 8,\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was updated */\n PRESENCE_UPDATE: PresenceUpdateEvent\n }\n}\n", "import { Emoji, GuildMember, integer, Internal, snowflake, User } from '.'\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\nexport namespace Reaction {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#message-reaction-add-message-reaction-add-event-fields */\n export interface Add {\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-events#message-reaction-remove-message-reaction-remove-event-fields */\n export interface Remove {\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-events#message-reaction-remove-all-message-reaction-remove-all-event-fields */\n export interface RemoveAll {\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-events#message-reaction-remove-emoji-message-reaction-remove-emoji */\n export interface RemoveEmoji {\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 }\n\n export interface GetParams {\n /** get users after this user ID */\n after?: snowflake\n /** max number of users to return (1-100) */\n limit?: integer\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user reacted to a message */\n MESSAGE_REACTION_ADD: Reaction.Event.Add\n /** user removed a reaction from a message */\n MESSAGE_REACTION_REMOVE: Reaction.Event.Remove\n /** all reactions were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_ALL: Reaction.Event.RemoveAll\n /** all reactions for a given emoji were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_EMOJI: Reaction.Event.RemoveEmoji\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#create-reaction\n */\n createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /**\n * Delete a reaction the current user has made for the message. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-own-reaction\n */\n deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /**\n * Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-user-reaction\n */\n deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>\n /**\n * Get a list of users that reacted with this emoji. Returns an array of user objects on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#get-reactions\n */\n getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, params?: Reaction.GetParams): Promise<User[]>\n /**\n * Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Fires a Message Reaction Remove All Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions\n */\n deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Deletes all the reactions for a given emoji on a message. This endpoint requires the MANAGE_MESSAGES permission to be present on the current user. Fires a Message Reaction Remove Emoji Gateway event. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji\n */\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 { integer, Internal, 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 /** Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels */\n MODERATE_MEMBERS = 1 << 40,\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\nexport namespace Role {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#create-guild-role-json-params */\n export interface Create {\n /** name of the role */\n name?: string\n /** bitwise value of the enabled/disabled permissions */\n permissions?: string\n /** RGB color value */\n color?: integer\n /** whether the role should be displayed separately in the sidebar */\n hoist?: boolean\n /** the role's icon image (if the guild has the ROLE_ICONS feature) */\n icon?: string\n /** the role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) */\n unicode_emoji?: string\n /** whether the role should be mentionable */\n mentionable?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions-json-params */\n export interface ModifyPositions {\n /** role */\n id: snowflake\n /** sorting position of the role */\n position?: integer\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-role-json-params */\n export interface Modify {\n /** name of the role */\n name?: string\n /** bitwise value of the enabled/disabled permissions */\n permissions?: string\n /** RGB color value */\n color?: integer\n /** whether the role should be displayed separately in the sidebar */\n hoist?: boolean\n /** the role's icon image (if the guild has the ROLE_ICONS feature) */\n icon?: string\n /** the role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) */\n unicode_emoji?: string\n /** whether the role should be mentionable */\n mentionable?: boolean\n }\n }\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 /** the id of this role's subscription sku and listing */\n subscription_listing_id?: snowflake\n /** whether this role is available for purchase */\n available_for_purchase?: null\n /** whether this role is a guild's linked role */\n guild_connections?: null\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of role objects for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-roles\n */\n getGuildRoles(guild_id: snowflake): Promise<Role[]>\n /**\n * Create a new role for the guild. Requires the MANAGE_ROLES permission. Returns the new role object on success. Fires a Guild Role Create Gateway event. All JSON params are optional.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-role\n */\n createGuildRole(guild_id: snowflake, param: Role.Params.Create): Promise<Role>\n /**\n * Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES permission. Returns a list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-role-positions\n */\n modifyGuildRolePositions(guild_id: snowflake, param: Role.Params.ModifyPositions): Promise<Role[]>\n /**\n * Modify a guild role. Requires the MANAGE_ROLES permission. Returns the updated role on success. Fires a Guild Role Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-role\n */\n modifyGuildRole(guild_id: snowflake, role_id: snowflake, param: Role.Params.Modify): Promise<Role>\n /**\n * Delete a guild role. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Role Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild-role\n */\n deleteGuildRole(guild_id: snowflake, role_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\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})\n", "import { GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */\nexport interface GuildScheduledEvent {\n /** the id of the scheduled event */\n id: snowflake\n /** the guild id which the scheduled event belongs to */\n guild_id: snowflake\n /** the channel id in which the scheduled event will be hosted, or null if scheduled entity type is EXTERNAL */\n channel_id?: snowflake\n /** the id of the user that created the scheduled event * */\n creator_id?: snowflake\n /** the name of the scheduled event (1-100 characters) */\n name: string\n /** the description of the scheduled event (1-1000 characters) */\n description?: string\n /** the time the scheduled event will start */\n scheduled_start_time: timestamp\n /** the time the scheduled event will end, required if entity_type is EXTERNAL */\n scheduled_end_time?: timestamp\n /** the privacy level of the scheduled event */\n privacy_level: GuildScheduledEvent.PrivacyLevel\n /** the status of the scheduled event */\n status: GuildScheduledEvent.Status\n /** the type of the scheduled event */\n entity_type: GuildScheduledEvent.EntityType\n /** the id of an entity associated with a guild scheduled event */\n entity_id?: snowflake\n /** additional metadata for the guild scheduled event */\n entity_metadata?: GuildScheduledEvent.EntityMetadata\n /** the user that created the scheduled event */\n creator?: User\n /** the number of users subscribed to the scheduled event */\n user_count?: integer\n /** the cover image hash of the scheduled event */\n image?: string\n}\n\nexport namespace GuildScheduledEvent {\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level */\n export enum PrivacyLevel {\n /** the scheduled event is only accessible to guild members */\n GUILD_ONLY = 2,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types */\n export enum EntityType {\n STAGE_INSTANCE = 1,\n VOICE = 2,\n EXTERNAL = 3,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status */\n export enum Status {\n SCHEDULED = 1,\n ACTIVE = 2,\n COMPLETED = 3,\n CANCELLED = 4,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata */\n export interface EntityMetadata {\n /** location of the event (1-100 characters) */\n location?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild-query-string-params */\n export interface ListParams {\n /** include number of users subscribed to each event */\n with_user_count?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event-json-params */\n export interface CreateParams {\n /** the channel id of the scheduled event. */\n channel_id?: snowflake\n /** the entity metadata of the scheduled event */\n entity_metadata?: EntityMetadata\n /** the name of the scheduled event */\n name: string\n /** the privacy level of the scheduled event */\n privacy_level: PrivacyLevel\n /** the time to schedule the scheduled event */\n scheduled_start_time: timestamp\n /** the time when the scheduled event is scheduled to end */\n scheduled_end_time?: timestamp\n /** the description of the scheduled event */\n description?: string\n /** the entity type of the scheduled event */\n entity_type: EntityType\n /** the cover image of the scheduled event */\n image?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-query-string-params */\n export interface GetParams {\n /** include number of users subscribed to this event */\n with_user_count?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event-json-params */\n export interface ModifyParams {\n /** the channel id of the scheduled event, set to null if changing entity type to EXTERNAL */\n channel_id?: snowflake\n /** the entity metadata of the scheduled event */\n entity_metadata?: EntityMetadata\n /** the name of the scheduled event */\n name?: string\n /** the privacy level of the scheduled event */\n privacy_level?: PrivacyLevel\n /** the time to schedule the scheduled event */\n scheduled_start_time?: timestamp\n /** the time when the scheduled event is scheduled to end */\n scheduled_end_time?: timestamp\n /** the description of the scheduled event */\n description?: string\n /** the entity type of the scheduled event */\n entity_type?: EntityType\n /** the status of the scheduled event */\n status?: Status\n /** the cover image of the scheduled event */\n image?: string\n }\n}\n\n/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure */\nexport interface GuildScheduledEventUser {\n /** the scheduled event id which the user subscribed to */\n guild_scheduled_event_id: snowflake\n /** user which subscribed to an event */\n user: User\n /** guild member data for this user for the guild which this event belongs to, if any */\n member?: GuildMember\n}\n\nexport namespace GuildScheduledEventUser {\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users-query-string-params */\n export interface GetParams {\n /** number of users to return (up to maximum 100) */\n limit?: number\n /** include guild member data if it exists */\n with_member?: boolean\n /** consider only users before given user id */\n before?: snowflake\n /** consider only users after given user id */\n after?: snowflake\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of guild scheduled event objects for the given guild.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild\n */\n listScheduledEventsforGuild(guildId: snowflake, params?: GuildScheduledEvent.ListParams): Promise<GuildScheduledEvent[]>\n /**\n * Create a guild scheduled event in the guild. Returns a guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event\n */\n createGuildScheduledEvent(guildId: snowflake, params: GuildScheduledEvent.CreateParams): Promise<GuildScheduledEvent>\n /**\n * Get a guild scheduled event. Returns a guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event\n */\n getGuildScheduledEvent(guildId: snowflake, eventId: snowflake, params?: GuildScheduledEvent.GetParams): Promise<GuildScheduledEvent>\n /**\n * Modify a guild scheduled event. Returns the modified guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event\n */\n modifyGuildScheduledEvent(guildId: snowflake, eventId: snowflake, params: GuildScheduledEvent.ModifyParams): Promise<GuildScheduledEvent>\n /**\n * Delete a guild scheduled event. Returns a 204 on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event\n */\n deleteGuildScheduledEvent(guildId: snowflake, eventId: snowflake): Promise<void>\n /**\n * Get a list of guild scheduled event users subscribed to a guild scheduled event.\n * Returns a list of guild scheduled event user objects on success.\n * Guild member data, if it exists, is included if the with_member query parameter is set.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users\n */\n getGuildScheduledEventUsers(guildId: snowflake, eventId: snowflake, params?: GuildScheduledEventUser.GetParams): Promise<GuildScheduledEventUser[]>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/scheduled-events': {\n GET: 'listScheduledEventsforGuild',\n POST: 'createGuildScheduledEvent',\n },\n '/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}': {\n GET: 'getGuildScheduledEvent',\n PATCH: 'modifyGuildScheduledEvent',\n DELETE: 'deleteGuildScheduledEvent',\n },\n '/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}/users': {\n GET: 'getGuildScheduledEventUsers',\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 /** The id of the scheduled event for this Stage instance */\n guild_scheduled_event_id?: snowflake\n}\n\nexport namespace StageInstance {\n export namespace Event {\n export interface Create extends StageInstance {}\n\n export interface Delete extends StageInstance {}\n\n export interface Update extends StageInstance {}\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance-json-params */\n export interface Create {\n /** The id of the 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 (default GUILD_ONLY) */\n privacy_level?: integer\n /** Notify @everyone that a Stage instance has started */\n send_start_notification?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance-json-params */\n export interface Modify {\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 }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** stage instance was created */\n STAGE_INSTANCE_CREATE: StageInstance.Event.Create\n /** stage instance was deleted or closed */\n STAGE_INSTANCE_DELETE: StageInstance.Event.Delete\n /** stage instance was updated */\n STAGE_INSTANCE_UPDATE: StageInstance.Event.Update\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Creates a new Stage instance associated to a Stage channel.\n * @see https://discord.com/developers/docs/resources/stage-instance#create-stage-instance\n */\n createStageInstance(params: StageInstance.Params.Create): Promise<StageInstance>\n /**\n * Gets the stage instance associated with the Stage channel, if it exists.\n * @see https://discord.com/developers/docs/resources/stage-instance#get-stage-instance\n */\n getStageInstance(channel_id: snowflake): Promise<StageInstance>\n /**\n * Updates fields of an existing Stage instance.\n * @see https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance\n */\n modifyStageInstance(channel_id: snowflake, params: StageInstance.Params.Modify): Promise<StageInstance>\n /**\n * Deletes the Stage instance.\n * @see https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance\n */\n deleteStageInstance(channel_id: snowflake): Promise<void>\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: Sticker.Type\n /** type of sticker format */\n format_type: Sticker.FormatType\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\nexport namespace Sticker {\n /** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types */\n export enum Type {\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 */\n export enum FormatType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n GIF = 4\n }\n\n /** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */\n export interface Item {\n /** id of the sticker */\n id: snowflake\n /** name of the sticker */\n name: string\n /** type of sticker format */\n format_type: FormatType\n }\n\n /** https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure */\n export interface Pack {\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 export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update-guild-stickers-update-event-fields */\n export interface Update {\n /** id of the guild */\n guild_id: snowflake\n /** array of stickers */\n stickers: Sticker[]\n }\n }\n\n /** https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs-response-structure */\n export interface PackResult {\n sticker_packs: Pack[]\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/sticker#create-guild-sticker-form-params */\n export interface Create {\n /** name of the sticker (2-30 characters) */\n name: string\n /** description of the sticker (empty or 2-100 characters) */\n description: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n /** the sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB */\n file: any\n }\n\n /** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker-json-params */\n export interface Modify {\n /** name of the sticker (2-30 characters) */\n name: string\n /** description of the sticker (2-100 characters) */\n description?: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild stickers were updated */\n GUILD_STICKERS_UPDATE: Sticker.Event.Update\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a sticker object for the given sticker ID.\n * @see https://discord.com/developers/docs/resources/sticker#get-sticker\n */\n getSticker(sticker_id: snowflake): Promise<Sticker>\n /**\n * Returns the list of sticker packs available to Nitro subscribers.\n * @see https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs\n */\n listNitroStickerPacks(): Promise<Sticker.PackResult>\n /**\n * Returns an array of sticker objects for the given guild. Includes user fields if the bot has the MANAGE_EMOJIS_AND_STICKERS permission.\n * @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers\n */\n listGuildStickers(guild_id: snowflake): Promise<Sticker[]>\n /**\n * Returns a sticker object for the given guild and sticker IDs. Includes the user field if the bot has the MANAGE_EMOJIS_AND_STICKERS permission.\n * @see https://discord.com/developers/docs/resources/sticker#get-guild-sticker\n */\n getGuildSticker(guild_id: snowflake, sticker_id: snowflake): Promise<Sticker>\n /**\n * Create a new sticker for the guild. Send a multipart/form-data body. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the new sticker object on success.\n * @see https://discord.com/developers/docs/resources/sticker#create-guild-sticker\n */\n createGuildSticker(guild_id: snowflake, params: Sticker.Params.Create): Promise<Sticker>\n /**\n * Modify the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the updated sticker object on success.\n * @see https://discord.com/developers/docs/resources/sticker#modify-guild-sticker\n */\n modifyGuildSticker(guild_id: snowflake, sticker_id: snowflake, params: Sticker.Params.Modify): Promise<Sticker>\n /**\n * Delete the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/resources/sticker#delete-guild-sticker\n */\n deleteGuildSticker(guild_id: snowflake, sticker_id: snowflake): Promise<void>\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 { AllowedMentions, Attachment, Channel, Component, Embed, GuildMember, integer, Internal, snowflake, timestamp } from '.'\n\ndeclare module './channel' {\n interface Channel {\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 }\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 /** additional information about the user */\n member?: GuildMember\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 /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */\n create_timestamp?: timestamp\n}\n\n/** @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads */\nexport interface ListActiveGuildThreadsResult {\n /** the active threads */\n threads: Channel[]\n /** a thread member object for each returned thread the current user has joined */\n members: ThreadMember[]\n}\n\nexport interface Thread extends Channel {}\n\nexport namespace Thread {\n /** https://discord.com/developers/docs/resources/channel#start-thread-from-message */\n export interface StartFromMessageParams {\n /** 1-100 character channel name */\n name: string\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 /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-without-message-json-params */\n export interface StartWithoutMessageParams {\n /** 1-100 character channel name */\n name: string\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 /** the type of thread to create */\n type?: integer\n /** whether non-moderators can add other non-moderators to a thread; only available when creating a private thread */\n invitable?: boolean\n /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */\n export interface StartThreadInFormChannelParams {\n /** 1-100 character channel name */\n name: string\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 /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n /** contents of the first message in the forum thread */\n message: FormThreadMessageParams\n /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */\n applied_tags?: snowflake[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */\n export interface FormThreadMessageParams {\n /** Message contents (up to 2000 characters) */\n content?: string\n /** Embedded rich content (up to 6000 characters) */\n embeds?: Embed[]\n /** Allowed mentions for the message */\n allowed_mentions?: AllowedMentions\n /** Components to include with the message */\n components?: Component[]\n /** IDs of up to 3 stickers in the server to send in the message */\n sticker_ids?: snowflake[]\n /** Contents of the file being sent. */\n files: any[]\n /** JSON-encoded body of non-file params, only for multipart/form-data requests. */\n payload_json?: string\n /** Attachment objects with filename and description. */\n attachments?: Partial<Attachment>[]\n /** Message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */\n flags?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-active-threads-response-body */\n export interface List {\n /** the active threads */\n threads: Channel[]\n /** a thread member object for each returned thread the current user has joined */\n members: ThreadMember[]\n /** whether there are potentially additional threads that could be returned on a subsequent call */\n has_more: boolean\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-public-archived-threads-query-string-params */\n export interface ListPublicArchivedParams {\n /** returns threads before this timestamp */\n before?: timestamp\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-private-archived-threads-query-string-params */\n export interface ListPrivateArchivedParams {\n /** returns threads before this timestamp */\n before?: timestamp\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads-query-string-params */\n export interface ListJoinedPrivateArchivedParams {\n /** returns threads before this id */\n before?: snowflake\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields */\n export interface ListSync {\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\n export interface MemberUpdate extends ThreadMember {}\n\n /** https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields */\n export interface MembersUpdate {\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}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** sent when gaining access to a channel, contains all active threads in that channel */\n THREAD_LIST_SYNC: Thread.Event.ListSync\n /** thread member for the current user was updated */\n THREAD_MEMBER_UPDATE: Thread.Event.MemberUpdate\n /** some user(s) were added to or removed from a thread */\n THREAD_MEMBERS_UPDATE: Thread.Event.MembersUpdate\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns all active threads in the guild, including public and private threads. Threads are ordered by their id, in descending order.\n * @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads\n */\n listActiveGuildThreads(guild_id: snowflake): Promise<ListActiveGuildThreadsResult>\n /**\n * Creates a new thread from an existing message. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-from-message\n */\n startThreadFromMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartFromMessageParams): Promise<Channel>\n /**\n * Creates a new thread in a forum channel, and sends a message within the created thread. Returns a channel, with a nested message object, on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create and Message Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel\n */\n startThreadInForumChannel(channel_id: snowflake, params: Thread.StartThreadInFormChannelParams): Promise<Channel>\n /**\n * Creates a new thread that is not connected to an existing message. The created thread defaults to a GUILD_PRIVATE_THREAD*. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-without-message\n */\n startThreadWithoutMessage(channel_id: snowflake, params: Thread.StartWithoutMessageParams): Promise<Channel>\n /**\n * Adds the current user to a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#join-thread\n */\n joinThread(channel_id: snowflake): Promise<void>\n /**\n * Adds another member to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response if the member is successfully added or was already a member of the thread. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#add-thread-member\n */\n addThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Removes the current user from a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#leave-thread\n */\n leaveThread(channel_id: snowflake): Promise<void>\n /**\n * Removes another member from a thread. Requires the MANAGE_THREADS permission, or the creator of the thread if it is a GUILD_PRIVATE_THREAD. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#remove-thread-member\n */\n removeThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Returns a thread member object for the specified user if they are a member of the thread, returns a 404 response otherwise.\n * @see https://discord.com/developers/docs/resources/channel#get-thread-member\n */\n getThreadMember(channel_id: snowflake, user_id: snowflake): Promise<ThreadMember>\n /**\n * Returns array of thread members objects that are members of the thread.\n * @see https://discord.com/developers/docs/resources/channel#list-thread-members\n */\n listThreadMembers(channel_id: snowflake): Promise<ThreadMember[]>\n /**\n * Returns all active threads in the channel, including public and private threads. Threads are ordered by their id, in descending order.\n * @see https://discord.com/developers/docs/resources/channel#list-active-threads\n */\n listActiveThreads(channel_id: snowflake): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are public. When called on a GUILD_TEXT channel, returns threads of type GUILD_PUBLIC_THREAD. When called on a GUILD_NEWS channel returns threads of type GUILD_NEWS_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires the READ_MESSAGE_HISTORY permission.\n * @see https://discord.com/developers/docs/resources/channel#list-public-archived-threads\n */\n listPublicArchivedThreads(channel_id: snowflake, params?: Thread.ListPublicArchivedParams): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n * @see https://discord.com/developers/docs/resources/channel#list-private-archived-threads\n */\n listPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListPrivateArchivedParams): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD, and the user has joined. Threads are ordered by their id, in descending order. Requires the READ_MESSAGE_HISTORY permission.\n * @see https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads\n */\n listJoinedPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListJoinedPrivateArchivedParams): Promise<Thread.List>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages/{message.id}/threads': {\n POST: 'startThreadFromMessage',\n },\n '/channels/{channel.id}/threads': {\n POST: ['startThreadWithoutMessage', 'startThreadInForumChannel'],\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/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 { 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?: PremiumType\n /** the public flags on a user's account */\n public_flags?: integer\n}\n\nexport namespace User {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#modify-current-user-json-params */\n export interface Modify {\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 }\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 BOT_HTTP_INTERACTIONS = 1 << 19,\n ACTIVE_DEVELOPER = 1 << 22,\n}\n\n/** https://discord.com/developers/docs/resources/user#user-object-premium-types */\nexport enum PremiumType {\n NONE = 0,\n NITRO_CLASSIC = 1,\n NITRO = 2,\n NITRO_BASIC = 3,\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 /** whether this connection has a corresponding third party OAuth2 token */\n two_way_link: 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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email.\n * @see https://discord.com/developers/docs/resources/user#get-current-user\n */\n getCurrentUser(): Promise<User>\n /**\n * Returns a user object for a given user ID.\n * @see https://discord.com/developers/docs/resources/user#get-user\n */\n getUser(id: snowflake): Promise<User>\n /**\n * Modify the requester's user account settings. Returns a user object on success.\n * @see https://discord.com/developers/docs/resources/user#modify-current-user\n */\n modifyCurrentUser(params: User.Params.Modify): Promise<User>\n /**\n * Returns a list of connection objects. Requires the connections OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-user-connections\n */\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/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\nexport namespace VoiceState {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state-json-params */\n export interface ModifyCurrent extends Modify {\n /** sets the user's request to speak */\n request_to_speak_timestamp?: timestamp\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-user-voice-state-json-params */\n export interface Modify {\n /** the id of the channel the user is currently in */\n channel_id: snowflake\n /** toggles the user's suppress state */\n suppress?: boolean\n }\n }\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-events#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 /**\n * Returns an array of voice region objects that can be used when setting a voice or stage channel's rtc_region.\n * @see https://discord.com/developers/docs/resources/voice#list-voice-regions\n */\n listVoiceRegions(): Promise<VoiceRegion[]>\n /**\n * Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-voice-regions\n */\n getGuildVoiceRegions(guild_id: snowflake): Promise<VoiceRegion[]>\n /**\n * Updates the current user's voice state.\n * @see https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state\n */\n modifyCurrentUserVoiceState(guild_id: snowflake, params: VoiceState.Params.ModifyCurrent): Promise<VoiceState>\n /**\n * Updates another user's voice state.\n * @see https://discord.com/developers/docs/resources/guild#modify-user-voice-state\n */\n modifyUserVoiceState(guild_id: snowflake, user_id: snowflake, params: VoiceState.Params.Modify): Promise<VoiceState>\n }\n}\n\nInternal.define({\n '/voice/regions': {\n GET: 'listVoiceRegions',\n },\n '/guilds/{guild.id}/regions': {\n GET: 'getGuildVoiceRegions',\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 { AllowedMentions, Attachment, Channel, Component, Embed, 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: Webhook.Type\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\nexport namespace Webhook {\n /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */\n export enum Type {\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/resources/webhook#create-webhook-json-params */\n export interface CreateParams {\n /** name of the webhook (1-80 characters) */\n name: string\n /** image for the default webhook avatar */\n avatar?: string\n }\n\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook-json-params */\n export interface ModifyParams {\n /** the default name of the webhook */\n name: string\n /** image 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\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params */\n export interface ExecuteParams {\n /** waits for server confirmation of message send before response, and returns the created message body (defaults to false; when false a message that is not saved does not return an error) */\n wait: boolean\n /** Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. */\n thread_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params */\n export interface ExecuteBody {\n /** the message contents (up to 2000 characters) */\n content: string\n /** override the default username of the webhook */\n username: string\n /** override the default avatar of the webhook */\n avatar_url: string\n /** true if this is a TTS message */\n tts: boolean\n /** embedded rich content */\n embeds: Embed[]\n /** allowed mentions for the message */\n allowed_mentions: AllowedMentions\n /** the components to include with the message */\n components: Component[]\n /** the contents of the file being sent */\n files: any\n /** JSON encoded body of non-file params */\n payload_json: string\n /** attachment objects with filename and description */\n attachments: Partial<Attachment>[]\n /** message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */\n flags: integer\n /** name of thread to create (requires the webhook channel to be a forum channel) */\n thread_name: string\n }\n\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params */\n export interface MessageParams {\n /** id of the thread the message is in */\n thread_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/webhook#edit-webhook-message-jsonform-params */\n export interface MessageBody {\n /** the message contents (up to 2000 characters) */\n content: string\n /** embedded rich content */\n embeds: Embed[]\n /** allowed mentions for the message */\n allowed_mentions: AllowedMentions\n /** the components to include with the message */\n components: Component[]\n /** the contents of the file being sent/edited */\n files: any\n /** JSON encoded body of non-file params (multipart/form-data only) */\n payload_json: string\n /** attached files to keep and possible descriptions for new files */\n attachments: Partial<Attachment>[]\n }\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#webhooks-update-webhooks-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\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:\n * @see https://discord.com/developers/docs/resources/webhook#create-webhook\n */\n createWebhook(channel_id: snowflake, params: Webhook.CreateParams): Promise<Webhook>\n /**\n * Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.\n * @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks\n */\n getChannelWebhooks(channel_id: snowflake): Promise<Webhook[]>\n /**\n * Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.\n * @see https://discord.com/developers/docs/resources/webhook#get-guild-webhooks\n */\n getGuildWebhooks(guild_id: snowflake): Promise<Webhook[]>\n /**\n * Returns the new webhook object for the given id.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook\n */\n getWebhook(webhook_id: snowflake): Promise<Webhook>\n /**\n * Same as above, except this call does not require authentication and returns no user in the webhook object.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook-with-token\n */\n getWebhookWithToken(webhook_id: snowflake, token: string): Promise<Webhook>\n /**\n * Modify a webhook. Requires the MANAGE_WEBHOOKS permission. Returns the updated webhook object on success.\n * @see https://discord.com/developers/docs/resources/webhook#modify-webhook\n */\n modifyWebhook(webhook_id: snowflake, params: Webhook.ModifyParams): Promise<Webhook>\n /**\n * Same as above, except this call does not require authentication, does not accept a channel_id parameter in the body, and does not return a user in the webhook object.\n * @see https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token\n */\n modifyWebhookWithToken(webhook_id: snowflake, token: string, params: Webhook.ModifyParams): Promise<Webhook>\n /**\n * Delete a webhook permanently. Requires the MANAGE_WEBHOOKS permission. Returns a 204 No Content response on success.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook\n */\n deleteWebhook(webhook_id: snowflake): Promise<void>\n /**\n * Same as above, except this call does not require authentication.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token\n */\n deleteWebhookwithToken(webhook_id: snowflake, token: string): Promise<void>\n /**\n * Refer to Uploading Files for details on attachments and multipart/form-data requests.\n * @see https://discord.com/developers/docs/resources/webhook#execute-webhook\n */\n executeWebhook(webhook_id: snowflake, token: string, body: Webhook.ExecuteBody, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Refer to Slack's documentation for more information. We do not support Slack's channel, icon_emoji, mrkdwn, or mrkdwn_in properties.\n * @see https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook\n */\n executeSlackCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Add a new webhook to your GitHub repo (in the repo's settings), and use this endpoint as the \"Payload URL.\" You can choose what events your Discord channel receives by choosing the \"Let me select individual events\" option and selecting individual events for the new webhook you're configuring.\n * @see https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook\n */\n executeGitHubCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Returns a previously-sent webhook message from the same token. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook-message\n */\n getWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): Promise<Message>\n /**\n * Edits a previously-sent webhook message from the same token. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/webhook#edit-webhook-message\n */\n editWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, body: Webhook.MessageBody, query: Webhook.MessageParams): Promise<void>\n /**\n * Deletes a message that was created by the webhook. Returns a 204 No Content response on success.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook-message\n */\n deleteWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): 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", "// Last updated: Jan 24, 2023\n\nexport * from './internal'\n\nexport * from './application'\nexport * from './application-role-connection'\nexport * from './audit-log'\nexport * from './auto-moderation'\nexport * from './ban'\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 './reaction'\nexport * from './role'\nexport * from './scheduled-event'\nexport * from './stage-instance'\nexport * from './sticker'\nexport * from './team'\nexport * from './thread'\nexport * from './user'\nexport * from './voice'\nexport * from './webhook'\n\nexport type integer = number\nexport type snowflake = string\nexport type timestamp = string\n\n/** @see https://discord.com/developers/docs/reference#locales */\nexport type Locale = typeof Locale[number]\n\nexport const Locale = [\n 'da', 'de', 'en-GB', 'en-US', 'es-ES',\n 'fr', 'hr', 'it', 'lt', 'hu',\n 'nl', 'no', 'pl', 'pt-BR', 'ro',\n 'fi', 'sv-SE', 'vi', 'tr', 'cs',\n 'el', 'bg', 'ru', 'uk', 'hi',\n 'th', 'zh-CN', 'ja', 'zh-TW', 'ko',\n] as const\n", "import { Dict, h, Logger, MessageEncoder, Quester, Schema, Session, Universal } from '@satorijs/satori'\nimport FormData from 'form-data'\nimport { DiscordBot } from './bot'\nimport { Channel, Message } from './types'\nimport { decodeMessage, sanitize } from './utils'\n\ntype RenderMode = 'default' | 'figure'\n\nconst logger = new Logger('discord')\n\nclass State {\n author: Partial<Universal.Author> = {}\n quote: Partial<Universal.Message> = {}\n channel: Partial<Channel> = {}\n fakeMessageMap: Record<string, Session[]> = {} // [userInput] = discord messages\n threadCreated = false // forward: send the first message and create a thread\n\n constructor(public type: 'message' | 'forward') { }\n}\n\nexport class DiscordMessageEncoder extends MessageEncoder<DiscordBot> {\n private stack: State[] = [new State('message')]\n private buffer: string = ''\n private addition: Dict = {}\n private figure: h = null\n private mode: RenderMode = 'default'\n private listType: 'ol' | 'ul' = null\n\n private async getUrl() {\n const input = this.options?.session?.discord\n if (input?.t === 'INTERACTION_CREATE') {\n // 消息交互\n return `/webhooks/${input.d.application_id}/${input.d.token}`\n } else if (this.stack[0].type === 'forward' && this.stack[0].channel?.id) {\n // 发送到子区\n if (this.stack[1].author.nickname || this.stack[1].author.avatar) {\n const webhook = await this.ensureWebhook()\n return `/webhooks/${webhook.id}/${webhook.token}?wait=true&thread_id=${this.stack[0].channel?.id}`\n } else {\n return `/channels/${this.stack[0].channel.id}/messages`\n }\n } else {\n if (this.stack[0].author.nickname || this.stack[0].author.avatar || (this.stack[0].type === 'forward' && !this.stack[0].threadCreated)) {\n const webhook = await this.ensureWebhook()\n return `/webhooks/${webhook.id}/${webhook.token}?wait=true`\n } else {\n return `/channels/${this.channelId}/messages`\n }\n }\n }\n\n async post(data?: any, headers?: any) {\n try {\n const url = await this.getUrl()\n const result = await this.bot.http.post<Message>(url, data, { headers })\n const session = this.bot.session()\n const message = await decodeMessage(this.bot, result, session)\n session.app.emit(session, 'send', session)\n this.results.push(session)\n\n if (this.stack[0].type === 'forward' && !this.stack[0].threadCreated) {\n this.stack[0].threadCreated = true\n const thread = await this.bot.internal.startThreadFromMessage(this.channelId, result.id, {\n name: 'Forward',\n auto_archive_duration: 60,\n })\n this.stack[0].channel = thread\n }\n\n return message\n } catch (e) {\n if (Quester.isAxiosError(e) && e.response) {\n if (e.response.data?.code === 10015) {\n logger.debug('webhook has been deleted, recreating..., %o', e.response.data)\n if (!this.bot.webhookLock[this.channelId]) this.bot.webhooks[this.channelId] = null\n await this.ensureWebhook()\n return this.post(data, headers)\n } else {\n e = new Error(`[${e.response.status}] ${JSON.stringify(e.response.data)}`)\n }\n }\n this.errors.push(e)\n }\n }\n\n async sendEmbed(attrs: Dict, payload: Dict) {\n const { filename, data, mime } = await this.bot.ctx.http.file(attrs.url, attrs)\n const form = new FormData()\n // https://github.com/form-data/form-data/issues/468\n const value = process.env.KOISHI_ENV === 'browser'\n ? new Blob([data], { type: mime })\n : Buffer.from(data)\n form.append('file', value, attrs.file || filename)\n form.append('payload_json', JSON.stringify(payload))\n return this.post(form, form.getHeaders())\n }\n\n async sendAsset(type: string, attrs: Dict<string>, addition: Dict) {\n const { handleMixedContent, handleExternalAsset } = this.bot.config as DiscordMessageEncoder.Config\n\n if (handleMixedContent === 'separate' && addition.content) {\n await this.post(addition)\n addition.content = ''\n }\n\n const sendDirect = async () => {\n if (addition.content) {\n await this.post(addition)\n }\n return this.post({ ...addition, content: attrs.url })\n }\n\n if (this.bot.http.isPrivate(attrs.url)) {\n return await this.sendEmbed(attrs, addition)\n }\n\n const mode = attrs.mode as DiscordMessageEncoder.HandleExternalAsset || handleExternalAsset\n if (mode === 'download' || handleMixedContent === 'attach' && addition.content || type === 'file') {\n return this.sendEmbed(attrs, addition)\n } else if (mode === 'direct') {\n return sendDirect()\n }\n\n // auto mode\n if (await this.checkMediaType(attrs.url, type)) {\n return sendDirect()\n } else {\n return this.sendEmbed(attrs, addition)\n }\n }\n\n checkMediaType(url: string, type: string) {\n if (url.startsWith('https://cdn.discordapp.com/')) return true\n return this.bot.ctx.http.head(url, {\n headers: { accept: type + '/*' },\n timeout: 1000,\n }).then(\n (headers) => headers['content-type'].startsWith(type),\n () => false,\n )\n }\n\n async ensureWebhook() {\n return this.bot.ensureWebhook(this.channelId)\n }\n\n async flush() {\n const content = this.buffer.trim()\n if (!content) return\n await this.post({ ...this.addition, content })\n this.buffer = ''\n this.addition = {}\n }\n\n async visit(element: h) {\n const { type, attrs, children } = element\n if (type === 'text') {\n this.buffer += sanitize(attrs.content)\n } else if (type === 'b' || type === 'strong') {\n this.buffer += '**'\n await this.render(children)\n this.buffer += '**'\n } else if (type === 'i' || type === 'em') {\n this.buffer += '*'\n await this.render(children)\n this.buffer += '*'\n } else if (type === 'u' || type === 'ins') {\n this.buffer += '__'\n await this.render(children)\n this.buffer += '__'\n } else if (type === 's' || type === 'del') {\n this.buffer += '~~'\n await this.render(children)\n this.buffer += '~~'\n } else if (type === 'spl') {\n this.buffer += '||'\n await this.render(children)\n this.buffer += '||'\n } else if (type === 'code') {\n this.buffer += '`'\n await this.render(children)\n this.buffer += '`'\n } else if (type === 'a') {\n await this.render(children)\n if (this.options.linkPreview) {\n this.buffer += ` (${attrs.href}) `\n } else {\n this.buffer += ` (<${attrs.href}>) `\n }\n } else if (type === 'br') {\n this.buffer += '\\n'\n } else if (type === 'p') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n await this.render(children)\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n this.buffer += '\\n'\n } else if (type === 'blockquote') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n this.buffer += '> '\n await this.render(children)\n this.buffer += '\\n'\n } else if (type === 'ul' || type === 'ol') {\n this.listType = type\n await this.render(children)\n this.listType = null\n } else if (type === 'li') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n if (this.listType === 'ol') {\n this.buffer += '0. '\n } else if (this.listType === 'ul') {\n this.buffer += '- '\n }\n this.render(children)\n this.buffer += '\\n'\n } else if (type === 'at') {\n if (attrs.id) {\n this.buffer += `<@${attrs.id}>`\n } else if (attrs.type === 'all') {\n this.buffer += `@everyone`\n } else if (attrs.type === 'here') {\n this.buffer += `@here`\n }\n } else if (type === 'sharp' && attrs.id) {\n this.buffer += `<#${attrs.id}>`\n } else if (type === 'face') {\n if (attrs.platform && attrs.platform !== this.bot.platform) {\n return this.render(children)\n } else {\n this.buffer += `<${attrs.animated ? 'a' : ''}:${attrs.name}:${attrs.id}>`\n }\n } else if ((type === 'image' || type === 'video') && attrs.url) {\n if (this.mode === 'figure') {\n this.figure = element\n } else {\n await this.sendAsset(type, attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n }\n } else if (type === 'share') {\n await this.flush()\n await this.post({\n ...this.addition,\n embeds: [{ ...attrs }],\n })\n } else if (type === 'audio') {\n await this.sendAsset('file', attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n } else if (type === 'author') {\n const { avatar, nickname } = attrs\n if (avatar) this.addition.avatar_url = avatar\n if (nickname) this.addition.username = nickname\n if (this.stack[0].type === 'message') {\n this.stack[0].author = attrs\n }\n if (this.stack[0].type === 'forward') {\n this.stack[1].author = attrs\n }\n } else if (type === 'quote') {\n await this.flush()\n const parse = (val: string) => val.replace(/\\\\([\\\\*_`~|()\\[\\]])/g, '$1')\n\n const message = this.stack[this.stack[0].type === 'forward' ? 1 : 0]\n if (!message.author.avatar && !message.author.nickname && this.stack[0].type !== 'forward') {\n // no quote and author, send by bot\n await this.flush()\n this.addition.message_reference = {\n message_id: attrs.id,\n }\n } else {\n // quote\n let replyId = attrs.id, channelId = this.channelId\n if (this.stack[0].type === 'forward' && this.stack[0].fakeMessageMap[attrs.id]?.length >= 1) {\n // quote to fake message, eg. 1st message has id (in channel or thread), later message quote to it\n replyId = this.stack[0].fakeMessageMap[attrs.id][0].messageId\n channelId = this.stack[0].fakeMessageMap[attrs.id][0].channelId\n }\n const quoted = await this.bot.getMessage(channelId, replyId)\n this.addition.embeds = [{\n description: [\n sanitize(parse(quoted.elements.filter(v => v.type === 'text').join('')).slice(0, 30)),\n `<t:${Math.ceil(quoted.timestamp / 1000)}:R> [[ ↑ ]](https://discord.com/channels/${this.guildId}/${channelId}/${replyId})`,\n ].join('\\n\\n'),\n author: {\n name: quoted.author.nickname || quoted.author.username,\n icon_url: quoted.author.avatar,\n },\n }]\n }\n } else if (type === 'figure') {\n await this.flush()\n this.mode = 'figure'\n await this.render(children)\n await this.sendAsset(this.figure.type, this.figure.attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n this.mode = 'default'\n } else if (type === 'message' && !attrs.forward) {\n if (this.mode === 'figure') {\n await this.render(children)\n this.buffer += '\\n'\n } else {\n const resultLength = +this.results.length\n await this.flush()\n\n await this.render(children)\n await this.flush()\n const newLength = +this.results.length\n const sentMessages = this.results.slice(resultLength, newLength)\n if (this.stack[0].type === 'forward' && attrs.id) {\n this.stack[0].fakeMessageMap[attrs.id] = sentMessages\n }\n if (this.stack[0].type === 'message') {\n this.stack[0].author = {}\n }\n if (this.stack[0].type === 'forward') {\n this.stack[1].author = {}\n }\n }\n } else if (type === 'message' && attrs.forward) {\n this.stack.unshift(new State('forward'))\n await this.render(children)\n await this.flush()\n await this.bot.internal.modifyChannel(this.stack[0].channel.id, {\n archived: true,\n locked: true,\n })\n this.stack.shift()\n } else {\n await this.render(children)\n }\n }\n}\n\nexport namespace DiscordMessageEncoder {\n export type HandleExternalAsset = 'auto' | 'download' | 'direct'\n export type HandleMixedContent = 'auto' | 'separate' | 'attach'\n\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 export const Config: Schema<DiscordMessageEncoder.Config> = Schema.object({\n handleExternalAsset: Schema.union([\n Schema.const('download').description('先下载后发送'),\n Schema.const('direct').description('直接发送链接'),\n Schema.const('auto').description('发送一个 HEAD 请求,根据返回的 Content-Type 决定发送方式'),\n ]).role('radio').description('发送外链资源时采用的方式。').default('auto'),\n handleMixedContent: Schema.union([\n Schema.const('separate').description('将每个不同形式的内容分开发送'),\n Schema.const('attach').description('图片前如果有文本内容,则将文本作为图片的附带信息进行发送'),\n Schema.const('auto').description('如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送'),\n ]).role('radio').description('发送图文等混合内容时采用的方式。').default('auto'),\n }).description('发送设置')\n}\n", "import { Adapter, Logger, Schema } from '@satorijs/satori'\nimport { Gateway } from './types'\nimport { adaptSession, decodeUser } from './utils'\nimport { DiscordBot } from './bot'\n\nconst logger = new Logger('discord')\n\nexport class WsClient extends Adapter.WsClient<DiscordBot> {\n _d = 0\n _ping: NodeJS.Timeout\n _sessionId = ''\n _resumeUrl: string\n\n async prepare() {\n if (this._resumeUrl) {\n return this.bot.http.ws(this._resumeUrl + '/?v=10&encoding=json')\n }\n const { url } = await this.bot.internal.getGatewayBot()\n return this.bot.http.ws(url + '/?v=10&encoding=json')\n }\n\n heartbeat() {\n logger.debug(`heartbeat d ${this._d}`)\n this.bot.socket.send(JSON.stringify({\n op: Gateway.Opcode.HEARTBEAT,\n d: this._d,\n }))\n }\n\n accept() {\n this.bot.socket.addEventListener('message', async ({ data }) => {\n let parsed: Gateway.Payload\n try {\n parsed = JSON.parse(data.toString())\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 this._d = parsed.s\n }\n\n // https://discord.com/developers/docs/topics/gateway#connection-lifecycle\n if (parsed.op === Gateway.Opcode.HELLO) {\n this._ping = setInterval(() => this.heartbeat(), parsed.d.heartbeat_interval)\n if (this._sessionId) {\n logger.debug('resuming')\n this.bot.socket.send(JSON.stringify({\n op: Gateway.Opcode.RESUME,\n d: {\n token: this.bot.config.token,\n session_id: this._sessionId,\n seq: this._d,\n },\n }))\n } else {\n this.bot.socket.send(JSON.stringify({\n op: Gateway.Opcode.IDENTIFY,\n d: {\n token: this.bot.config.token,\n properties: {},\n compress: false,\n intents: this.bot.config.intents,\n },\n }))\n }\n }\n\n if (parsed.op === Gateway.Opcode.INVALID_SESSION) {\n if (parsed.d) return\n this._sessionId = ''\n logger.warn('offline: invalid session')\n this.bot.socket?.close()\n }\n\n if (parsed.op === Gateway.Opcode.DISPATCH) {\n this.bot.ctx.emit('discord/' + parsed.t.toLowerCase().replace(/_/g, '-') as any, parsed)\n if (parsed.t === 'READY') {\n this._sessionId = parsed.d.session_id\n this._resumeUrl = parsed.d.resume_gateway_url\n const user = decodeUser(parsed.d.user)\n Object.assign(this.bot, user)\n logger.debug('session_id ' + this._sessionId)\n return this.bot.online()\n }\n if (parsed.t === 'RESUMED') {\n return this.bot.online()\n }\n const session = await adaptSession(this.bot, parsed)\n if (session) this.bot.dispatch(session)\n }\n\n if (parsed.op === Gateway.Opcode.RECONNECT) {\n logger.warn('offline: discord request reconnect')\n this.bot.socket?.close()\n }\n })\n\n this.bot.socket.addEventListener('close', () => {\n clearInterval(this._ping)\n })\n }\n}\n\nexport namespace WsClient {\n export interface Config extends Adapter.WsClient.Config {\n intents?: number\n }\n\n export const Config: Schema<Config> = Schema.intersect([\n Schema.object({\n intents: Schema.bitset(Gateway.Intent).description('需要订阅的机器人事件。').default(0\n | Gateway.Intent.GUILD_MESSAGES\n | Gateway.Intent.GUILD_MESSAGE_REACTIONS\n | Gateway.Intent.DIRECT_MESSAGES\n | Gateway.Intent.DIRECT_MESSAGE_REACTIONS\n | Gateway.Intent.MESSAGE_CONTENT),\n }).description('推送设置'),\n Adapter.WsClient.Config,\n ] as const)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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AApBS;AAAA,CAsBF,CAAUG,gBAAV;AAME,EAAMA,YAAA,SAAyB,sBAAO,UAAU;AAAA,IACrD,sBAAO,OAAO;AAAA,MACZ,OAAO,sBAAO,OAAO,EAAE,YAAY,WAAW,EAAE,KAAK,QAAQ,EAAE,SAAS;AAAA,IAC1E,CAAC;AAAA,IACD,sBAAO,OAAO;AAAA,MACZ,OAAO,sBAAO,QAAQ,EAAE,YAAY,WAAW,EAAE,QAAQ,IAAI;AAAA,IAC/D,CAAC,EAAE,YAAY,MAAM;AAAA,IACrB,SAAS;AAAA,IACT,sBAAsB;AAAA,IACtB,uBAAQ,aAAa,6BAA6B;AAAA,EACpD,CAAC;AAAA,GAhBc;;;ADpPjB,IAAO,cAAQ;",
6
- "names": ["import_satori", "ApplicationCommand", "AutoModerationRule", "Channel", "Guild", "GuildScheduledEvent", "Locale", "Message", "StatusType", "Sticker", "Webhook", "import_satori", "ApplicationFlag", "ApplicationRoleConnection", "MetadataType", "AuditLog", "Type", "AutoModerationRule", "EventType", "TriggerType", "KeywordPresetType", "AutoModerationAction", "Type", "Channel", "Type", "OverwriteType", "AllowedMentionType", "ApplicationCommand", "Type", "OptionType", "PermissionType", "ComponentType", "ButtonStyles", "TextInputStyles", "DeviceType", "Gateway", "Opcode", "Intent", "Guild", "Params", "WidgetStyleOptions", "SystemChannelFlag", "GuildFeature", "IntegrationExpireBehavior", "Interaction", "Type", "CallbackType", "Invite", "TargetType", "Message", "Type", "ActivityType", "Flag", "StatusType", "ActivityType", "ActivityFlag", "Permission", "GuildScheduledEvent", "PrivacyLevel", "EntityType", "Status", "Sticker", "Type", "FormatType", "MembershipState", "UserFlag", "PremiumType", "VisibilityType", "Webhook", "Type", "Locale", "_a", "_b", "_c", "ApplicationCommand", "Locale", "import_satori", "FormData", "DiscordMessageEncoder", "import_satori", "logger", "WsClient", "logger", "data", "ApplicationCommand", "DiscordBot"]
4
+ "sourcesContent": ["import { DiscordBot } from './bot'\nimport * as Discord from './utils'\n\nexport { Discord }\n\nexport * from './bot'\nexport * from './message'\nexport * from './ws'\n\nexport default DiscordBot\n\ntype ParamCase<S extends string> =\n | S extends `${infer L}${infer R}`\n ? `${L extends '_' ? '-' : Lowercase<L>}${ParamCase<R>}`\n : S\n\ntype DiscordEvents = {\n [T in keyof Discord.GatewayEvents as `discord/${ParamCase<T>}`]: (input: Discord.GatewayEvents[T]) => void\n}\n\ndeclare module '@satorijs/core' {\n interface Session {\n discord?: Discord.Gateway.Payload & Discord.Internal\n }\n\n interface Events extends DiscordEvents {}\n}\n", "import { Bot, Context, Fragment, h, isNullable, Logger, Quester, Schema, Universal } from '@satorijs/satori'\nimport * as Discord from './utils'\nimport { DiscordMessageEncoder } from './message'\nimport { Internal, Webhook } from './types'\nimport { WsClient } from './ws'\n\n// @ts-ignore\nimport { version } from '../package.json'\n\nconst logger = new Logger('discord')\n\nexport class DiscordBot extends Bot<DiscordBot.Config> {\n static MessageEncoder = DiscordMessageEncoder\n\n public http: Quester\n public internal: Internal\n public webhooks: Record<string, Webhook> = {}\n public webhookLock: Record<string, Promise<Webhook>> = {}\n public commands: Universal.Command[] = []\n\n constructor(ctx: Context, config: DiscordBot.Config) {\n super(ctx, config)\n this.platform = 'discord'\n this.http = ctx.http.extend({\n ...config,\n headers: {\n Authorization: `Bot ${config.token}`,\n 'User-Agent': `Koishi (https://koishi.chat/, ${version})`,\n ...config.headers,\n },\n })\n this.internal = new Internal(this.http)\n ctx.plugin(WsClient, this)\n }\n\n private async _ensureWebhook(channelId: string) {\n let webhook: Webhook\n const webhooks = await this.internal.getChannelWebhooks(channelId)\n const selfId = this.selfId\n if (!webhooks.find(v => v.name === 'Koishi' && v.user.id === selfId)) {\n webhook = await this.internal.createWebhook(channelId, {\n name: 'Koishi',\n })\n // webhook may be `AxiosError: Request failed with status code 429` error\n } else {\n webhook = webhooks.find(v => v.name === 'Koishi' && v.user.id === this.selfId)\n }\n return this.webhooks[channelId] = webhook\n }\n\n async ensureWebhook(channelId: string) {\n if (this.webhooks[channelId] === null) {\n delete this.webhooks[channelId]\n delete this.webhookLock[channelId]\n }\n if (this.webhooks[channelId]) {\n delete this.webhookLock[channelId]\n return this.webhooks[channelId]\n }\n return this.webhookLock[channelId] ||= this._ensureWebhook(channelId)\n }\n\n async getLogin() {\n const data = await this.internal.getCurrentUser()\n this.user = Discord.decodeUser(data)\n return this.toJSON()\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: Fragment) {\n const elements = h.normalize(content)\n content = elements.toString()\n const image = elements.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) {\n const data = await this.internal.getChannelMessage(channelId, messageId)\n return await Discord.decodeMessage(this, data, {})\n }\n\n async getMessageList(channelId: string, before?: string) {\n const messages = await this.internal.getChannelMessages(channelId, { before, limit: 100 })\n const data = await Promise.all(messages.reverse().map(data => Discord.decodeMessage(this, data, {}, undefined, false)))\n return { data, next: data[0]?.id }\n }\n\n async getUser(userId: string) {\n const data = await this.internal.getUser(userId)\n return Discord.decodeUser(data)\n }\n\n async getGuildMemberList(guildId: string, after?: string) {\n const users = await this.internal.listGuildMembers(guildId, { after, limit: 1000 })\n const data = users.map(v => Discord.decodeGuildMember(v))\n return { data, next: data[999]?.user.id }\n }\n\n async getChannel(channelId: string) {\n const data = await this.internal.getChannel(channelId)\n return Discord.decodeChannel(data)\n }\n\n async getGuildMember(guildId: string, userId: string) {\n const member = await this.internal.getGuildMember(guildId, userId)\n return Discord.decodeGuildMember(member)\n }\n\n async kickGuildMember(guildId: string, userId: string) {\n return this.internal.removeGuildMember(guildId, userId)\n }\n\n async getGuild(guildId: string) {\n const data = await this.internal.getGuild(guildId)\n return Discord.decodeGuild(data)\n }\n\n async getGuildList(after?: string) {\n const guilds = await this.internal.getCurrentUserGuilds({ after, limit: 200 })\n const data = guilds.map(Discord.decodeGuild)\n return { data, next: data[199]?.id }\n }\n\n async getChannelList(guildId: string) {\n const channels = await this.internal.getGuildChannels(guildId)\n return { data: channels.map(Discord.decodeChannel) }\n }\n\n createReaction(channelId: string, messageId: string, emoji: string) {\n return this.internal.createReaction(channelId, messageId, emoji)\n }\n\n deleteReaction(channelId: string, messageId: string, emoji: string, userId?: string) {\n if (!userId) {\n return this.internal.deleteOwnReaction(channelId, messageId, emoji)\n } else {\n return this.internal.deleteUserReaction(channelId, messageId, emoji, userId)\n }\n }\n\n clearReaction(channelId: string, messageId: string, emoji?: string) {\n if (!emoji) {\n return this.internal.deleteAllReactions(channelId, messageId)\n } else {\n return this.internal.deleteAllReactionsForEmoji(channelId, messageId, emoji)\n }\n }\n\n async getReactionList(channelId: string, messageId: string, emoji: string, after?: string) {\n const data = await this.internal.getReactions(channelId, messageId, emoji, { after, limit: 100 })\n return { data: data.map(Discord.decodeUser), next: data[99]?.id }\n }\n\n setGuildMemberRole(guildId: string, userId: string, roleId: string) {\n return this.internal.addGuildMemberRole(guildId, userId, roleId)\n }\n\n unsetGuildMemberRole(guildId: string, userId: string, roleId: string) {\n return this.internal.removeGuildMemberRole(guildId, userId, roleId)\n }\n\n async getGuildRoleList(guildId: string) {\n const data = await this.internal.getGuildRoles(guildId)\n return { data: data.map(Discord.decodeRole) }\n }\n\n async createGuildRole(guildId: string, data: Partial<Universal.GuildRole>) {\n const role = await this.internal.createGuildRole(guildId, Discord.encodeRole(data))\n return Discord.decodeRole(role)\n }\n\n async updateGuildRole(guildId: string, roleId: string, data: Partial<Universal.GuildRole>) {\n await this.internal.modifyGuildRole(guildId, roleId, Discord.encodeRole(data))\n }\n\n deleteGuildRole(guildId: string, roleId: string) {\n return this.internal.deleteGuildRole(guildId, roleId)\n }\n\n async createDirectChannel(userId: string) {\n const channel = await this.internal.createDM({ recipient_id: userId })\n return Discord.decodeChannel(channel)\n }\n\n async updateCommands(commands: Universal.Command[]) {\n if (!this.config.slash) return\n this.commands = commands\n const local = Object.fromEntries(commands.map(cmd => [cmd.name, cmd] as const))\n const remote = Object.fromEntries((await this.internal.getGlobalApplicationCommands(this.selfId, { with_localizations: true }))\n .filter(cmd => cmd.type === Discord.ApplicationCommand.Type.CHAT_INPUT)\n .map(cmd => [cmd.name, cmd] as const))\n const updates: any[] = []\n for (const key in { ...local, ...remote }) {\n if (!local[key]) {\n logger.debug('delete command %s', key)\n await this.internal.deleteGlobalApplicationCommand(this.selfId, remote[key].id)\n continue\n }\n const data = Discord.encodeCommand(local[key])\n logger.debug(data, remote[key])\n if (!remote[key]) {\n logger.debug('create command: %s', local[key].name)\n updates.push(data)\n } else if (!shapeEqual(data, remote[key])) {\n logger.debug('edit command: %s', local[key].name)\n updates.push(data)\n }\n }\n if (updates.length) {\n await this.internal.bulkOverwriteGlobalApplicationCommands(this.selfId, updates)\n }\n }\n}\n\nfunction shapeEqual(a: any, b: any) {\n if (a === b) return true\n if (isNullable(a) && isNullable(b)) return true\n\n if (typeof a !== typeof b) return false\n if (typeof a !== 'object') return false\n if (Object.values(a).every(isNullable) && isNullable(b)) return true\n // ^ a = { foo: undefined }, b = null\n if (!a || !b) return false\n\n // check array\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) return false\n return a.every((item, index) => shapeEqual(item, b[index]))\n } else if (Array.isArray(b)) {\n return false\n }\n\n // check object\n return Object.keys(a).every(key => shapeEqual(a[key], b[key]))\n}\n\nexport namespace DiscordBot {\n export interface Config extends Quester.Config, DiscordMessageEncoder.Config, WsClient.Config {\n token: string\n slash?: boolean\n }\n\n export const Config: Schema<Config> = Schema.intersect([\n Schema.object({\n token: Schema.string().description('机器人的用户令牌。').role('secret').required(),\n }),\n Schema.object({\n slash: Schema.boolean().description('是否启用斜线指令。').default(true),\n }).description('功能设置'),\n WsClient.Config,\n DiscordMessageEncoder.Config,\n Quester.createConfig('https://discord.com/api/v10'),\n ])\n}\n", "import { Dict, h, pick, Session, Universal, valueMap } from '@satorijs/satori'\nimport { DiscordBot } from './bot'\nimport * as Discord from './types'\n\nexport * from './types'\n\nexport const sanitize = (val: string) =>\n val\n .replace(/[\\\\*_`~|()\\[\\]]/g, '\\\\$&')\n .replace(/@everyone/g, () => '\\\\@everyone')\n .replace(/@here/g, () => '\\\\@here')\n\nexport const decodeUser = (user: Discord.User): Universal.User => ({\n id: user.id,\n name: user.username,\n userId: user.id,\n avatar: user.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 const decodeGuildMember = (member: Partial<Discord.GuildMember>): Universal.GuildMember => ({\n user: member.user && decodeUser(member.user),\n name: member.nick,\n roles: member.roles,\n joinedAt: member.joined_at && new Date(member.joined_at).valueOf(),\n})\n\nexport const decodeGuild = (data: Discord.Guild): Universal.Guild => ({\n id: data.id,\n name: data.name,\n})\n\nexport const decodeChannel = (data: Discord.Channel): Universal.Channel => ({\n id: data.id,\n name: data.name,\n type: data.type === Discord.Channel.Type.DM ? Universal.Channel.Type.DIRECT : Universal.Channel.Type.TEXT,\n})\n\nexport const decodeRole = (role: Discord.Role): Universal.GuildRole => ({\n ...role,\n permissions: BigInt(role.permissions),\n})\n\nexport const encodeRole = (role: Partial<Universal.GuildRole>): Partial<Discord.Role> => ({\n ...role,\n permissions: role.permissions && '' + role.permissions,\n})\n\nexport async function decodeMessage(\n bot: DiscordBot,\n data: Discord.Message,\n message: Universal.Message,\n payload: Universal.MessageLike = message,\n details = true,\n) {\n const { platform } = bot\n\n message.id = message.messageId = data.id\n // https://discord.com/developers/docs/reference#message-formatting\n message.content = ''\n if (data.content) {\n message.content = data.content\n .replace(/<@[!&]?(.+?)>/g, (_, id) => {\n if (data.mention_roles.includes(id)) {\n return h('at', { role: id }).toString()\n } else {\n const user = data.mentions?.find(u => u.id === id || `${u.username}#${u.discriminator}` === id)\n return h.at(id, { name: user?.username }).toString()\n }\n })\n .replace(/<a?:(.*):(.+?)>/g, (_, name, id) => {\n const animated = _[1] === 'a'\n return h('face', { id, name, animated, platform }, [\n h.image(`https://cdn.discordapp.com/emojis/${id}.gif?quality=lossless`),\n ]).toString()\n })\n .replace(/@everyone/g, () => h('at', { type: 'all' }).toString())\n .replace(/@here/g, () => h('at', { type: 'here' }).toString())\n .replace(/<#(.+?)>/g, (_, id) => {\n const channel = data.mention_channels?.find(c => c.id === id)\n return h.sharp(id, { name: channel?.name }).toString()\n })\n }\n\n // embed 的 update event 太阴间了 只有 id embeds channel_id guild_id 四个成员\n if (data.attachments?.length) {\n if (message.content) message.content += ' '\n message.content += data.attachments.map(v => {\n if (v.height && v.width && v.content_type?.startsWith('image/')) {\n return h('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 h('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 h('record', {\n url: v.url,\n proxy_url: v.proxy_url,\n file: v.filename,\n })\n } else {\n return h('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 data.embeds) {\n // not using embed types\n // https://discord.com/developers/docs/resources/channel#embed-object-embed-types\n if (embed.image) {\n message.content += h('image', { url: embed.image.url, proxy_url: embed.image.proxy_url })\n }\n if (embed.thumbnail) {\n message.content += h('image', { url: embed.thumbnail.url, proxy_url: embed.thumbnail.proxy_url })\n }\n if (embed.video) {\n message.content += h('video', { url: embed.video.url, proxy_url: embed.video.proxy_url })\n }\n }\n message.elements = h.parse(message.content)\n // 遇到过 cross post 的消息在这里不会传消息 id\n if (details && data.message_reference) {\n const { message_id, channel_id } = data.message_reference\n message.quote = await bot.getMessage(channel_id, message_id)\n }\n\n if (!payload) return message\n payload.channel = {\n id: data.channel_id,\n type: data.member ? Universal.Channel.Type.TEXT : Universal.Channel.Type.DIRECT,\n }\n payload.user = decodeUser(data.author)\n payload.member = data.member && decodeGuildMember(data.member)\n payload.timestamp = new Date(data.timestamp).valueOf() || Date.now()\n return message\n}\n\nexport function setupMessageGuildId(session: Partial<Session>, guildId: string) {\n session.guildId = guildId\n session.isDirect = !guildId\n session.subtype = guildId ? 'group' : 'private'\n}\n\ntype ReactionEvent = Partial<\n & Discord.Reaction.Event.Add\n & Discord.Reaction.Event.Remove\n & Discord.Reaction.Event.RemoveAll\n & Discord.Reaction.Event.RemoveEmoji>\n\nfunction setupReaction(session: Partial<Session>, data: ReactionEvent) {\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.isDirect = !data.guild_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: Discord.Gateway.Payload) {\n const session = bot.session()\n session.setInternal('discord', input)\n if (input.t === 'MESSAGE_CREATE') {\n setupMessageGuildId(session, input.d.guild_id)\n if (input.d.webhook_id && !session.isDirect) {\n try {\n // 403 Missing Permissions\n const webhook = await bot.ensureWebhook(input.d.channel_id)\n // koishi's webhook\n if (webhook.id === input.d.webhook_id) return\n } catch (e) {}\n }\n session.type = 'message'\n await decodeMessage(bot, input.d, session.event.message = {}, session.event)\n // dc 情况特殊 可能有 embeds 但是没有消息主体\n // if (!session.content) return\n } else if (input.t === 'MESSAGE_UPDATE') {\n session.type = 'message-updated'\n const message = 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-events#message-update\n await decodeMessage(bot, message, session.event.message = {}, session.event)\n const channel = await bot.internal.getChannel(input.d.channel_id)\n setupMessageGuildId(session, channel.guild_id)\n // if (!session.content) return\n } else if (input.t === 'MESSAGE_DELETE') {\n session.type = 'message-deleted'\n session.messageId = input.d.id\n session.channelId = input.d.channel_id\n setupMessageGuildId(session, input.d.guild_id)\n } else if (input.t === 'MESSAGE_REACTION_ADD') {\n session.type = 'reaction-added'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE') {\n session.type = 'reaction-deleted'\n session.subtype = 'one'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_ALL') {\n session.type = 'reaction-deleted'\n session.subtype = 'all'\n setupReaction(session, input.d)\n } else if (input.t === 'MESSAGE_REACTION_REMOVE_EMOJI') {\n session.type = 'reaction-deleted'\n session.subtype = 'emoji'\n setupReaction(session, input.d)\n } else if (input.t === 'GUILD_ROLE_CREATE') {\n session.type = 'guild-role-added'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role.id\n session.event.role = decodeRole(input.d.role)\n } else if (input.t === 'GUILD_ROLE_UPDATE') {\n session.type = 'guild-role-updated'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role.id\n session.event.role = decodeRole(input.d.role)\n } else if (input.t === 'GUILD_ROLE_DELETE') {\n session.type = 'guild-role-added'\n session.guildId = input.d.guild_id\n session.roleId = input.d.role_id\n } else if (input.t === 'INTERACTION_CREATE' && input.d.type === Discord.Interaction.Type.APPLICATION_COMMAND) {\n const data = input.d.data as Discord.InteractionData.ApplicationCommand\n const command = bot.commands.find(cmd => cmd.name === data.name)\n if (!command) return\n await bot.internal.createInteractionResponse(input.d.id, input.d.token, {\n type: Discord.Interaction.CallbackType.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE,\n })\n session.type = 'interaction/command'\n session.isDirect = !input.d.guild_id\n session.subtype = input.d.guild_id ? 'group' : 'private'\n session.channelId = input.d.channel_id\n session.guildId = input.d.guild_id\n session.userId = session.isDirect ? input.d.user.id : input.d.member.user.id\n session.messageId = input.d.id\n session.content = ''\n session.event.argv = decodeArgv(data, command)\n } else if (input.t === 'CHANNEL_UPDATE') {\n session.type = 'channel-updated'\n session.guildId = input.d.guild_id\n session.subtype = input.d.guild_id ? 'group' : 'private'\n session.channelId = input.d.id\n } else {\n return\n }\n return session\n}\n\nconst types = {\n text: Discord.ApplicationCommand.OptionType.STRING,\n string: Discord.ApplicationCommand.OptionType.STRING,\n boolean: Discord.ApplicationCommand.OptionType.BOOLEAN,\n number: Discord.ApplicationCommand.OptionType.NUMBER,\n integer: Discord.ApplicationCommand.OptionType.INTEGER,\n posint: Discord.ApplicationCommand.OptionType.INTEGER,\n user: Discord.ApplicationCommand.OptionType.STRING,\n channel: Discord.ApplicationCommand.OptionType.STRING,\n guild: Discord.ApplicationCommand.OptionType.STRING,\n}\n\ninterface Description {\n name: string\n description: Dict<string>\n}\n\nconst trimDescription = (source: string) => {\n if (!source || source.length < 96) return source\n return source.slice(0, 93) + '...'\n}\n\nconst encodeDescription = (object: Description) => ({\n description: trimDescription(object.description[''] || object.name),\n description_localizations: valueMap(pick(object.description, Discord.Locale), trimDescription),\n})\n\nexport const encodeCommand = (cmd: Universal.Command): Discord.ApplicationCommand.Params.Create => ({\n ...encodeDescription(cmd),\n name: cmd.name,\n type: Discord.ApplicationCommand.Type.CHAT_INPUT,\n options: encodeCommandOptions(cmd),\n})\n\nconst decodeArgv = (data: Discord.InteractionData.ApplicationCommand, command: Universal.Command) => {\n const result = { name: data.name, arguments: [], options: {} } as Universal.Argv\n for (const argument of command.arguments) {\n const value = data.options?.find(opt => opt.name === argument.name)?.value\n if (value !== undefined) result.arguments.push(value)\n }\n for (const option of command.options) {\n const value = data.options?.find(opt => opt.name === option.name)?.value\n if (value !== undefined) result.options[option.name] = value\n }\n return result\n}\n\nexport function encodeCommandOptions(cmd: Universal.Command): Discord.ApplicationCommand.Option[] {\n const result: Discord.ApplicationCommand.Option[] = []\n if (cmd.children.length) {\n result.push(...cmd.children.map(child => ({\n name: child.name.slice(cmd.name.length + 1),\n type: child.children.length\n ? Discord.ApplicationCommand.OptionType.SUB_COMMAND_GROUP\n : Discord.ApplicationCommand.OptionType.SUB_COMMAND,\n options: encodeCommandOptions(child),\n description: cmd.description[''] || child.name,\n description_localizations: pick(cmd.description, Discord.Locale),\n })))\n } else {\n // `getGlobalApplicationCommands()` does not return `required` property.\n for (const arg of cmd.arguments) {\n result.push({\n ...encodeDescription(arg),\n name: arg.name.toLowerCase().replace(/[^a-z0-9]/g, ''),\n type: types[arg.type] ?? types.text,\n // required: arg.required ?? false,\n })\n }\n for (const option of cmd.options) {\n result.push({\n ...encodeDescription(option),\n name: option.name.toLowerCase(),\n type: types[option.type] ?? types.text,\n // required: option.required ?? false,\n min_value: option.type === 'posint' ? 1 : undefined,\n })\n }\n }\n return result.sort((a, b) => +b.required - +a.required)\n}\n", "import { Dict, makeArray, Quester } from '@satorijs/satori'\n\nexport class Internal {\n constructor(private http: Quester) {}\n\n static define(routes: Dict<Partial<Record<Quester.Method, string | string[]>>>) {\n for (const path in routes) {\n for (const key in routes[path]) {\n const method = key as Quester.Method\n for (const name of makeArray(routes[path][method])) {\n Internal.prototype[name] = async function (this: Internal, ...args: any[]) {\n const raw = args.join(', ')\n const url = path.replace(/\\{([^}]+)\\}/g, () => {\n if (!args.length) throw new Error(`too few arguments for ${path}, received ${raw}`)\n return args.shift()\n })\n const config: Quester.AxiosRequestConfig = {}\n if (args.length === 1) {\n if (method === 'GET' || method === 'DELETE') {\n config.params = args[0]\n } else {\n config.data = args[0]\n }\n } else if (args.length === 2 && method !== 'GET' && method !== 'DELETE') {\n config.data = args[0]\n config.params = args[1]\n } else if (args.length > 1) {\n throw new Error(`too many arguments for ${path}, received ${raw}`)\n }\n try {\n return await this.http(method, url, config)\n } catch (error) {\n if (!Quester.isAxiosError(error) || !error.response) throw error\n throw new Error(`[${error.response.status}] ${JSON.stringify(error.response.data)}`)\n }\n }\n }\n }\n }\n }\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 /** deprecated, 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 /** up to 5 tags describing the content and functionality of the application */\n tags?: [string, string?, string?, string?, string?]\n /** settings for the application's default in-app authorization link, if enabled */\n install_params?: InstallParams\n /** the application's default custom authorization link, if enabled */\n custom_install_url?: string\n /** the application's role connection verification entry point, which when configured will render the app as a verification method in the guild role verification configuration */\n role_connections_verification_url?: string\n}\n\nexport interface InstallParams {\n /** the scopes to add the application to the server with */\n scopes: string[]\n /** the permissions to request for the bot role */\n permissions: string\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 GATEWAY_MESSAGE_CONTENT = 1 << 18,\n GATEWAY_MESSAGE_CONTENT_LIMITED = 1 << 19,\n APPLICATION_COMMAND_BADGE = 1 << 23,\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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 /** gateway URL for resuming connections */\n resume_gateway_url: 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 /** response to Resume */\n RESUMED: {}\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the bot's application object.\n * @see https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information\n */\n getCurrentBotApplicationInformation(): Promise<Application>\n /**\n * Returns info about the current authorization. Requires authentication with a bearer token.\n * @see https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information\n */\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 { Internal, Locale } from '.'\n\nexport namespace ApplicationRoleConnection {\n /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure */\n export interface Metadata {\n /** type of metadata value */\n type: MetadataType\n /** dictionary key for the metadata field (must be a-z, 0-9, or _ characters; 1-50 characters) */\n key: string\n /** name of the metadata field (1-100 characters) */\n name: string\n /** translations of the name */\n name_localizations?: Record<Locale, string>\n /** description of the metadata field (1-200 characters) */\n description: string\n /** translations of the description */\n description_localizations?: Record<Locale, string>\n }\n\n /** https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type */\n export enum MetadataType {\n /** the metadata value (integer) is less than or equal to the guild's configured value (integer) */\n INTEGER_LESS_THAN_OR_EQUAL = 1,\n /** the metadata value (integer) is greater than or equal to the guild's configured value (integer) */\n INTEGER_GREATER_THAN_OR_EQUAL = 2,\n /** the metadata value (integer) is equal to the guild's configured value (integer) */\n INTEGER_EQUAL = 3,\n /** the metadata value (integer) is not equal to the guild's configured value (integer) */\n INTEGER_NOT_EQUAL = 4,\n /** the metadata value (ISO8601 string) is less than or equal to the guild's configured value (integer; days before current date) */\n DATETIME_LESS_THAN_OR_EQUAL = 5,\n /** the metadata value (ISO8601 string) is greater than or equal to the guild's configured value (integer; days before current date) */\n DATETIME_GREATER_THAN_OR_EQUAL = 6,\n /** the metadata value (integer) is equal to the guild's configured value (integer; 1) */\n BOOLEAN_EQUAL = 7,\n /** the metadata value (integer) is not equal to the guild's configured value (integer; 1) */\n BOOLEAN_NOT_EQUAL = 8,\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of application role connection metadata objects for the given application.\n * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records\n */\n getApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>\n /**\n * Updates and returns a list of application role connection metadata objects for the given application.\n * @see https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records\n */\n updateApplicationRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnection.Metadata[]>\n }\n}\n\nInternal.define({\n '/applications/{application.id}/role-connections/metadata': {\n GET: 'getApplicationRoleConnectionMetadataRecords',\n PUT: 'updateApplicationRoleConnectionMetadataRecords',\n },\n})\n", "import { ApplicationCommand, AutoModerationRule, Channel, GuildScheduledEvent, integer, 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 application commands referenced in the audit log */\n application_commands: ApplicationCommand[]\n /** list of audit log entries */\n audit_log_entries: AuditLog.Entry[]\n /** list of auto moderation rules referenced in the audit log */\n auto_moderation_rules: AutoModerationRule[]\n /** list of guild scheduled events referenced in the audit log */\n guild_scheduled_events: GuildScheduledEvent[]\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\nexport namespace AuditLog {\n /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure */\n export interface Entry {\n /** id of the affected entity (webhook, user, role, etc.) */\n target_id?: string\n /** changes made to the target_id */\n changes?: Change[]\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: Type\n /** additional info for certain action types */\n options?: OptionalInfo\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 */\n export enum Type {\n /** Server settings were updated */\n GUILD_UPDATE = 1,\n /** Channel was created */\n CHANNEL_CREATE = 10,\n /** Channel settings were updated */\n CHANNEL_UPDATE = 11,\n /** Channel was deleted */\n CHANNEL_DELETE = 12,\n /** Permission overwrite was added to a channel */\n CHANNEL_OVERWRITE_CREATE = 13,\n /** Permission overwrite was updated for a channel */\n CHANNEL_OVERWRITE_UPDATE = 14,\n /** Permission overwrite was deleted from a channel */\n CHANNEL_OVERWRITE_DELETE = 15,\n /** Member was removed from server */\n MEMBER_KICK = 20,\n /** Members were pruned from server */\n MEMBER_PRUNE = 21,\n /** Member was banned from server */\n MEMBER_BAN_ADD = 22,\n /** Server ban was lifted for a member */\n MEMBER_BAN_REMOVE = 23,\n /** Member was updated in server */\n MEMBER_UPDATE = 24,\n /** Member was added or removed from a role */\n MEMBER_ROLE_UPDATE = 25,\n /** Member was moved to a different voice channel */\n MEMBER_MOVE = 26,\n /** Member was disconnected from a voice channel */\n MEMBER_DISCONNECT = 27,\n /** Bot user was added to server */\n BOT_ADD = 28,\n /** Role was created */\n ROLE_CREATE = 30,\n /** Role was edited */\n ROLE_UPDATE = 31,\n /** Role was deleted */\n ROLE_DELETE = 32,\n /** Server invite was created */\n INVITE_CREATE = 40,\n /** Server invite was updated */\n INVITE_UPDATE = 41,\n /** Server invite was deleted */\n INVITE_DELETE = 42,\n /** Webhook was created */\n WEBHOOK_CREATE = 50,\n /** Webhook properties or channel were updated */\n WEBHOOK_UPDATE = 51,\n /** Webhook was deleted */\n WEBHOOK_DELETE = 52,\n /** Emoji was created */\n EMOJI_CREATE = 60,\n /** Emoji name was updated */\n EMOJI_UPDATE = 61,\n /** Emoji was deleted */\n EMOJI_DELETE = 62,\n /** Single message was deleted */\n MESSAGE_DELETE = 72,\n /** Multiple messages were deleted */\n MESSAGE_BULK_DELETE = 73,\n /** Message was pinned to a channel */\n MESSAGE_PIN = 74,\n /** Message was unpinned from a channel */\n MESSAGE_UNPIN = 75,\n /** App was added to server */\n INTEGRATION_CREATE = 80,\n /** App was updated (as an example, its scopes were updated) */\n INTEGRATION_UPDATE = 81,\n /** App was removed from server */\n INTEGRATION_DELETE = 82,\n /** Stage instance was created (stage channel becomes live) */\n STAGE_INSTANCE_CREATE = 83,\n /** Stage instance details were updated */\n STAGE_INSTANCE_UPDATE = 84,\n /** Stage instance was deleted (stage channel no longer live) */\n STAGE_INSTANCE_DELETE = 85,\n /** Sticker was created */\n STICKER_CREATE = 90,\n /** Sticker details were updated */\n STICKER_UPDATE = 91,\n /** Sticker was deleted */\n STICKER_DELETE = 92,\n /** Event was created */\n GUILD_SCHEDULED_EVENT_CREATE = 100,\n /** Event was updated */\n GUILD_SCHEDULED_EVENT_UPDATE = 101,\n /** Event was cancelled */\n GUILD_SCHEDULED_EVENT_DELETE = 102,\n /** Thread was created in a channel */\n THREAD_CREATE = 110,\n /** Thread was updated */\n THREAD_UPDATE = 111,\n /** Thread was deleted */\n THREAD_DELETE = 112,\n /** Permissions were updated for a command */\n APPLICATION_COMMAND_PERMISSION_UPDATE = 121,\n /** Auto Moderation rule was created */\n AUTO_MODERATION_RULE_CREATE = 140,\n /** Auto Moderation rule was updated */\n AUTO_MODERATION_RULE_UPDATE = 141,\n /** Auto Moderation rule was deleted */\n AUTO_MODERATION_RULE_DELETE = 142,\n /** Message was blocked by AutoMod */\n AUTO_MODERATION_BLOCK_MESSAGE = 143,\n /** Message was flagged by AutoMod */\n AUTO_MODERATION_FLAG_TO_CHANNEL = 144,\n /** Member was timed out by AutoMod */\n AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145,\n }\n\n /** https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info */\n export interface OptionalInfo {\n /** ID of the app whose permissions were targeted */\n application_id: snowflake\n /** name of the Auto Moderation rule that was triggered */\n auto_moderation_rule_name: string\n /** trigger type of the Auto Moderation rule that was triggered */\n auto_moderation_rule_trigger_type: string\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 */\n export interface Change {\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\n /** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log-query-string-params */\n export interface GetParams {\n /** entries from a specific user ID */\n user_id?: snowflake\n /** entries for a specific audit log event */\n action_type?: Type\n /** entries that preceded a specific audit log entry ID */\n before?: snowflake\n /** entries that succeeded a specific audit log entry ID */\n after?: snowflake\n /** maximum number of entries (between 1-100) to return, defaults to 50 */\n limit?: integer\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an audit log object for the guild. Requires the 'VIEW_AUDIT_LOG' permission.\n * @see https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log\n */\n getGuildAuditLog(guildId: snowflake, params?: AuditLog.GetParams): Promise<AuditLog>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/audit-logs': {\n GET: 'getGuildAuditLog',\n },\n})\n", "import { integer, Internal, snowflake } from '.'\n\n/** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure */\nexport interface AutoModerationRule {\n /** the id of this rule */\n id: snowflake\n /** the id of the guild which this rule belongs to */\n guild_id: snowflake\n /** the rule name */\n name: string\n /** the user which first created this rule */\n creator_id: snowflake\n /** the rule event type */\n event_type: AutoModerationRule.EventType\n /** the rule trigger type */\n trigger_type: AutoModerationRule.TriggerType\n /** the rule trigger metadata */\n trigger_metadata: AutoModerationRule.TriggerMetadata\n /** the actions which will execute when the rule is triggered */\n actions: AutoModerationAction[]\n /** whether the rule is enabled */\n enabled: boolean\n /** the role ids that should not be affected by the rule (Maximum of 20) */\n exempt_roles: snowflake[]\n /** the channel ids that should not be affected by the rule (Maximum of 50) */\n exempt_channels: snowflake[]\n}\n\nexport namespace AutoModerationRule {\n /**\n * Indicates in what event context a rule should be checked.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types\n */\n export const enum EventType {\n /** when a member sends or edits a message in the guild */\n MESSAGE_SEND = 1,\n }\n\n /**\n * Characterizes the type of content which can trigger the rule.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types\n */\n export const enum TriggerType {\n /** check if content contains words from a user defined list of keywords (max per guild: 3) */\n KEYWORD = 1,\n /** check if content represents generic spam (max per guild: 1) */\n SPAM = 3,\n /** check if content contains words from internal pre-defined wordsets (max per guild: 1) */\n KEYWORD_PRESET = 4,\n /** check if content contains more unique mentions than allowed (max per guild: 1) */\n MENTION_SPAM = 5,\n }\n\n /**\n * Additional data used to determine whether a rule should be triggered.\n * Different fields are relevant based on the value of trigger_type.\n * @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata\n */\n export interface TriggerMetadata {\n /** associated with `KEYWORD`: substrings which will be searched for in content */\n keyword_filter: string[]\n /** regular expression patterns which will be matched against content (Maximum of 10) */\n regex_patterns: string[]\n /** associated with `KEYWORD_PRESET`: the internally pre-defined wordsets which will be searched for in content */\n presets: KeywordPresetType[]\n /** associated with `KEYWORD_PRESET`: substrings which will be exempt from triggering the preset trigger type */\n allow_list: string[]\n /** associated with `MENTION_SPAM`: total number of unique role and user mentions allowed per message (Maximum of 50) */\n mention_total_limit: integer\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types */\n export const enum KeywordPresetType {\n /** Words that may be considered forms of swearing or cursing */\n PROFANITY = 1,\n /** Words that refer to sexually explicit behavior or activity */\n SEXUAL_CONTEN = 2,\n /** Personal insults or words that may be considered hate speech */\n SLURS = 3,\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule-json-params */\n export interface CreateParams {\n /** the rule name */\n name: string\n /** the event type */\n event_type: EventType\n /** the trigger type */\n trigger_type: TriggerType\n /** the trigger metadata */\n trigger_metadata?: TriggerMetadata\n /** the actions which will execute when the rule is triggered */\n actions: AutoModerationAction[]\n /** whether the rule is enabled (False by default) */\n enabled?: boolean\n /** the role ids that should not be affected by the rule (Maximum of 20) */\n exempt_roles?: snowflake[]\n /** the channel ids that should not be affected by the rule (Maximum of 50) */\n exempt_channels?: snowflake[]\n }\n}\n\n/** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure */\nexport interface AutoModerationAction {\n /** the type of action */\n type: AutoModerationAction.Type\n /** additional metadata needed during execution for this specific action type */\n metadata?: AutoModerationAction.Metadata\n}\n\nexport namespace AutoModerationAction {\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types */\n export const enum Type {\n /** blocks the content of a message according to the rule */\n BLOCK_MESSAGE = 1,\n /** logs user content to a specified channel */\n SEND_ALERT_MESSAGE = 2,\n /**\n * timeout user for a specified duration\n *\n * A `TIMEOUT` action can only be set up for `KEYWORD` and `MENTION_SPAM` rules.\n * The `MODERATE_MEMBERS` permission is required to use the `TIMEOUT` action type.)\n */\n TIMEOUT = 3,\n }\n\n /** @see https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata */\n export interface Metadata {\n /**\n * associated with `SEND_ALERT_MESSAGE`:\n * channel to which user content should be logged\n */\n channel_id?: snowflake\n /**\n * associated with `TIMEOUT`:\n * timeout duration in seconds, maximum of 2419200 seconds (4 weeks)\n */\n duration_seconds?: integer\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Get a list of all rules currently configured for the guild.\n * Returns a list of auto moderation rule objects for the given guild.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild\n */\n listAutoModerationRules(guildId: snowflake): Promise<AutoModerationRule[]>\n /**\n * Get a single rule. Returns an auto moderation rule object.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule\n */\n getAutoModerationRule(guildId: snowflake, ruleId: snowflake): Promise<AutoModerationRule>\n /**\n * Create a new rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Create Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule\n */\n createAutoModerationRule(guildId: snowflake, data: AutoModerationRule.CreateParams): Promise<AutoModerationRule>\n /**\n * Modify an existing rule. Returns an auto moderation rule on success.\n * Fires an Auto Moderation Rule Update Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule\n */\n modifyAutoModerationRule(guildId: snowflake, ruleId: snowflake, data: Partial<AutoModerationRule.CreateParams>): Promise<AutoModerationRule>\n /**\n * Delete a rule. Returns a 204 on success. Fires an Auto Moderation Rule Delete Gateway event.\n * This endpoint requires the `MANAGE_GUILD` permission.\n * @see https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule\n */\n deleteAutoModerationRule(guildId: snowflake, ruleId: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/auto-moderation/rules': {\n GET: 'listAutoModerationRules',\n POST: 'createAutoModerationRule',\n },\n '/guilds/{guild.id}/auto-moderation/rules/{rule.id}': {\n GET: 'getAutoModerationRule',\n PATCH: 'modifyAutoModerationRule',\n DELETE: 'deleteAutoModerationRule',\n },\n})\n", "import { integer, Internal, snowflake, User } from '.'\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\nexport namespace Ban {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-ban-add-guild-ban-add-event-fields */\n export interface Add {\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-events#guild-ban-remove-guild-ban-remove-event-fields */\n export interface Remove {\n /** id of the guild */\n guild_id: snowflake\n /** the unbanned user */\n user: User\n }\n }\n\n /** @see https://discord.com/developers/docs/resources/guild#get-guild-bans-query-string-params */\n export interface GetParams {\n /** number of users to return (up to maximum 1000) */\n limit?: number\n /** consider only users before given user id */\n before?: snowflake\n /** consider only users after given user id */\n after?: snowflake\n }\n\n /** @see https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params */\n export interface CreateParams {\n /** number of days to delete messages for (0-7) (deprecated) */\n delete_message_days?: integer\n /** number of seconds to delete messages for, between 0 and 604800 (7 days) */\n delete_message_seconds?: integer\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was banned from a guild */\n GUILD_BAN_ADD: Ban.Event.Add\n /** user was unbanned from a guild */\n GUILD_BAN_REMOVE: Ban.Event.Remove\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-bans\n */\n getGuildBans(guild_id: snowflake, params: Ban.GetParams): Promise<Ban[]>\n /**\n * Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-ban\n */\n getGuildBan(guild_id: snowflake, user_id: snowflake): Promise<Ban>\n /**\n * Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Ban Add Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-ban\n */\n createGuildBan(guild_id: snowflake, user_id: snowflake, params?: Ban.CreateParams): Promise<void>\n /**\n * Remove the ban for a user. Requires the BAN_MEMBERS permissions. Returns a 204 empty response on success. Fires a Guild Ban Remove Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-ban\n */\n removeGuildBan(guild_id: snowflake, user_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\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})\n", "import { GuildMember, integer, Internal, snowflake, ThreadMember, ThreadMetadata, 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: Channel.Type\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 /** number of messages (not including the initial message or deleted messages) in a thread. */\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, copied onto newly created threads, in minutes, threads will stop showing in the channel list after the specified period of inactivity, 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 /** channel flags combined as a bitfield */\n flags?: integer\n /** number of messages ever sent in a thread, it's similar to message_count on message creation, but will not decrement the number when a message is deleted */\n total_message_sent?: integer\n /** the set of tags that can be used in a GUILD_FORUM channel */\n available_tags?: ForumTag[]\n /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */\n applied_tags?: snowflake[]\n /** the emoji to show in the add reaction button on a thread in a GUILD_FORUM channel */\n default_reaction_emoji?: DefaultReaction\n /** the initial rate_limit_per_user to set on newly created threads in a channel. this field is copied to the thread at creation time and does not live update. */\n default_thread_rate_limit_per_user?: integer\n /** the default sort order type used to order posts in GUILD_FORUM channels. Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin */\n default_sort_order?: integer\n /** the default forum layout view used to display posts in GUILD_FORUM channels. Defaults to 0, which indicates a layout view has not been set by a channel admin */\n default_forum_layout?: integer\n}\n\n/** https://discord.com/developers/docs/resources/channel#role-subscription-data-object */\nexport interface RoleSubscriptionData {\n /** the id of the sku and listing that the user is subscribed to */\n role_subscription_listing_id: snowflake\n /** the name of the tier that the user is subscribed to */\n tier_name: string\n /** the cumulative number of months that the user has been subscribed for */\n total_months_subscribed: integer\n /** whether this notification is for a renewal rather than a new purchase */\n is_renewal: boolean\n}\n\nexport namespace Channel {\n /** https://discord.com/developers/docs/resources/channel#channel-object-channel-types */\n export enum Type {\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 /** the channel in a hub containing the listed servers */\n GUILD_DIRECTORY = 14,\n /** Channel that can only contain threads */\n GUILD_FORUM = 15,\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#create-dm-json-params */\n export interface CreateDM {\n /** the recipient to open a DM channel with */\n recipient_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/user#create-group-dm-json-params */\n export interface CreateGroupDM {\n /** access tokens of users that have granted your app the gdm.join scope */\n access_tokens: string[]\n /** a dictionary of user ids to their respective nicknames */\n nicks: Record<string, string>\n }\n\n /** https://discord.com/developers/docs/resources/guild#create-guild-channel-json-params */\n export interface Create {\n /** channel name (1-100 characters) */\n name: string\n /** the type of channel */\n type: integer\n /** channel topic (0-1024 characters) */\n topic: string\n /** the bitrate (in bits) of the voice channel (voice only) */\n bitrate: integer\n /** the user limit of the voice channel (voice only) */\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 /** sorting position of the channel */\n position: integer\n /** the channel's permission overwrites */\n permission_overwrites: Overwrite[]\n /** id of the parent category for a channel */\n parent_id: snowflake\n /** whether the channel is nsfw */\n nsfw: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params */\n export interface ModifyPositions {\n /** channel id */\n 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\n export type Modify =\n | Partial<Modify.GroupDM>\n | Partial<Modify.GuildChannel>\n | Partial<Modify.Thread>\n\n export namespace Modify {\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-group-dm */\n export interface GroupDM {\n /** 1-100 character channel name */\n name: string\n /** base64 encoded icon */\n icon: string\n }\n\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel */\n export interface GuildChannel {\n /** 1-100 character channel name */\n name: string\n /** the type of channel; only conversion between text and news is supported and only in guilds with the \"NEWS\" feature */\n type: integer\n /** the position of the channel in the left-hand listing */\n position?: integer\n /** 0-1024 character channel topic */\n topic?: string\n /** whether the channel is nsfw */\n nsfw?: boolean\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 bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) */\n bitrate?: integer\n /** the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit */\n user_limit?: integer\n /** channel or category-specific permissions */\n permission_overwrites?: Overwrite[]\n /** id of the new parent category for a channel */\n parent_id?: snowflake\n /** channel voice region id, automatic when set to null */\n rtc_region?: string\n /** the camera video quality mode of the voice channel */\n video_quality_mode?: integer\n /** the default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity */\n default_auto_archive_duration?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#modify-channel-json-params-thread */\n export interface Thread {\n /** 1-100 character channel name */\n name: string\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 /** 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 /** amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected */\n rate_limit_per_user?: integer\n }\n }\n\n /** https://discord.com/developers/docs/resources/channel#edit-channel-permissions-json-params */\n export interface EditPermissions {\n /** the bitwise value of all allowed permissions */\n allow: string\n /** the bitwise value of all disallowed permissions */\n deny: string\n /** 0 for a role or 1 for a member */\n type: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#follow-news-channel-json-params */\n export interface Follow {\n /** id of target channel */\n webhook_channel_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient-json-params */\n export interface AddRecipient {\n /** access token of a user that has granted your app the gdm.join scope */\n access_token: string\n /** nickname of the user being added */\n nick: string\n }\n }\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 enum OverwriteType {\n ROLE = 0,\n MEMBER = 1,\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: OverwriteType\n /** permission bit set */\n allow: string\n /** permission bit set */\n deny: string\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-events#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-events#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\n/** https://discord.com/developers/docs/resources/channel#forum-tag-object */\nexport interface ForumTag {\n /** the id of the tag */\n id: snowflake\n /** the name of the tag (0-20 characters) */\n name: string\n /** whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission */\n moderated: boolean\n /** the id of a guild's custom emoji */\n emoji_id?: snowflake\n /** the unicode character of the emoji */\n emoji_name?: string\n}\n\n/** https://discord.com/developers/docs/resources/channel#default-reaction-object */\nexport interface DefaultReaction {\n /** the id of a guild's custom emoji */\n emoji_id?: snowflake\n /** the unicode character of the emoji */\n emoji_name?: string\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 /** 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 /**\n * Create a new DM channel with a user. Returns a DM channel object.\n * @see https://discord.com/developers/docs/resources/user#create-dm\n */\n createDM(params: Channel.Params.CreateDM): Promise<Channel>\n /**\n * Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. DMs created with this endpoint will not be shown in the Discord client\n * @see https://discord.com/developers/docs/resources/user#create-group-dm\n */\n createGroupDM(params: Channel.Params.CreateGroupDM): Promise<Channel>\n }\n}\n\nInternal.define({\n '/users/@me/channels': {\n POST: ['createDM', 'createGroupDM'],\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of guild channel objects. Does not include threads.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-channels\n */\n getGuildChannels(guild_id: snowflake): Promise<Channel[]>\n /**\n * Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-channel\n */\n createGuildChannel(guild_id: snowflake, params: Channel.Params.Create): Promise<Channel>\n /**\n * Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Returns a 204 empty response on success. Fires multiple Channel Update Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions\n */\n modifyGuildChannelPositions(guild_id: snowflake, params: Channel.Params.ModifyPositions): 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 /**\n * Get a channel by ID. Returns a channel object. If the channel is a thread, a thread member object is included in the returned result.\n * @see https://discord.com/developers/docs/resources/channel#get-channel\n */\n getChannel(channel_id: snowflake): Promise<Channel>\n /**\n * Update a channel's settings. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. All JSON parameters are optional.\n * @see https://discord.com/developers/docs/resources/channel#modify-channel\n */\n modifyChannel(channel_id: snowflake, params: Channel.Params.Modify): Promise<Channel>\n /**\n * Delete a channel, or close a private message. Requires the MANAGE_CHANNELS permission for the guild, or MANAGE_THREADS if the channel is a thread. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway event (or Thread Delete if the channel was a thread).\n * @see https://discord.com/developers/docs/resources/channel#deleteclose-channel\n */\n deleteChannel(channel_id: snowflake): Promise<Channel>\n /**\n * Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel). Returns a 204 empty response on success. For more information about permissions, see permissions.\n * @see https://discord.com/developers/docs/resources/channel#edit-channel-permissions\n */\n editChannelPermissions(channel_id: snowflake, overwrite_id: string, params: Channel.Params.EditPermissions): Promise<void>\n /**\n * Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. For more information about permissions, see permissions\n * @see https://discord.com/developers/docs/resources/channel#delete-channel-permission\n */\n deleteChannelPermission(channel_id: snowflake, overwrite_id: string): Promise<void>\n /**\n * Follow a News Channel to send messages to a target channel. Requires the MANAGE_WEBHOOKS permission in the target channel. Returns a followed channel object.\n * @see https://discord.com/developers/docs/resources/channel#follow-news-channel\n */\n followNewsChannel(channel_id: snowflake, params: Channel.Params.Follow): Promise<void>\n /**\n * Post a typing indicator for the specified channel. Generally bots should not implement this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a Typing Start Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#trigger-typing-indicator\n */\n triggerTypingIndicator(channel_id: snowflake): Promise<void>\n /**\n * Adds a recipient to a Group DM using their access token.\n * @see https://discord.com/developers/docs/resources/channel#group-dm-add-recipient\n */\n groupDMAddRecipient(channel_id: snowflake, user_id: snowflake, params: Channel.Params.AddRecipient): Promise<void>\n /**\n * Removes a recipient from a Group DM.\n * @see https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient\n */\n groupDMRemoveRecipient(channel_id: snowflake, user_id: snowflake): Promise<void>\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}/followers': {\n POST: 'followNewsChannel',\n },\n '/channels/{channel.id}/typing': {\n POST: 'triggerTypingIndicator',\n },\n '/channels/{channel.id}/recipients/{user.id}': {\n PUT: 'groupDMAddRecipient',\n DELETE: 'groupDMRemoveRecipient',\n },\n})\n", "import { Channel, integer, Internal, Locale, 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?: ApplicationCommand.Type\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 /** Name of command, 1-32 characters */\n name: string\n /** Localization dictionary for name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** Description for `CHAT_INPUT` commands, 1-100 characters. Empty string for `USER` and `MESSAGE` commands */\n description: string\n /** Localization dictionary for description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command, max 25 */\n options?: ApplicationCommand.Option[]\n /** Set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** Indicates whether the command is age-restricted, defaults to false */\n nsfw?: boolean\n /** autoincrementing version identifier updated during substantial record changes */\n version: snowflake\n}\n\nexport namespace ApplicationCommand {\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */\n export enum Type {\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 */\n export interface Option {\n /** the type of option */\n type: OptionType\n /** 1-32 character name */\n name: string\n /** Localization dictionary for the `name` field. Values follow the same restrictions as `name` */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description: string\n /** Localization dictionary for the `description` field. Values follow the same restrictions as `description` */\n description_localizations?: Record<Locale, 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?: OptionChoice[]\n /** if the option is a subcommand or subcommand group type, this nested options will be the parameters */\n options?: Option[]\n /** if the option is a channel type, the channels shown will be restricted to these types */\n channel_types?: Channel.Type[]\n /** if the option is an `INTEGER` or `NUMBER` type, the minimum value permitted. integer for `INTEGER` options, double for `NUMBER` options */\n min_value?: number\n /** if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted. integer for `INTEGER` options, double for `NUMBER` options */\n max_value?: number\n /** For option type `STRING`, the minimum allowed length (minimum of 0, maximum of 6000) */\n min_length?: integer\n /** For option type `STRING`, the minimum allowed length (maximum of 1, maximum of 6000) */\n max_length?: integer\n /** If autocomplete interactions are enabled for this `STRING`, `INTEGER`, or `NUMBER` type option */\n autocomplete?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */\n export enum OptionType {\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 /** attachment object */\n ATTACHMENT = 11,\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */\n export interface OptionChoice {\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 /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */\n export interface GuildPermissions {\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: Permissions[]\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */\n export interface Permissions {\n /**\n * ID of the role, user, or channel.\n * It can also be a [permission constant](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants):\n * - `guild_id`: All members in a guild\n * - `guild_id - 1`: All channels in a guild\n */\n id: snowflake\n /** role or user */\n type: PermissionType\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 */\n export enum PermissionType {\n ROLE = 1,\n USER = 2,\n CHANNEL = 3,\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands-query-string-params */\n export interface Get {\n /** Whether to include full localization dictionaries (name_localizations and description_localizations) in the returned objects, instead of the name_localized and description_localized fields. Default false. */\n with_localizations: boolean\n }\n /** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command-json-params */\n export interface Create {\n /** 1-32 character name */\n name: string\n /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description?: string\n /** localization dictionary for the description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command */\n options?: Option[]\n /** set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** the type of command, defaults 1 if not set */\n type?: Type\n /** indicates whether the command is age-restricted */\n nsfw?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */\n export interface Edit {\n /** 1-32 character name */\n name: string\n /** localization dictionary for the name field. Values follow the same restrictions as name */\n name_localizations?: Record<Locale, string>\n /** 1-100 character description */\n description?: string\n /** localization dictionary for the description field. Values follow the same restrictions as description */\n description_localizations?: Record<Locale, string>\n /** the parameters for the command */\n options?: Option[]\n /** set of permissions represented as a bit set */\n default_member_permissions?: string\n /** Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible. */\n dm_permission?: boolean\n /** whether the command is enabled by default when the app is added to a guild */\n default_permission?: boolean\n /** indicates whether the command is age-restricted */\n nsfw?: boolean\n }\n\n /** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */\n export interface EditPermissions {\n /** the permissions for the command in the guild */\n permissions: Permissions[]\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /**\n * sent when an application command's permissions are updated\n * @see https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update\n */\n APPLICATION_COMMAND_PERMISSIONS_UPDATE: ApplicationCommand.GuildPermissions\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Fetch all of the global commands for your application. Returns an array of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands\n */\n getGlobalApplicationCommands(application_id: snowflake, param?: ApplicationCommand.Params.Get): Promise<ApplicationCommand[]>\n /**\n * Creating a command with the same name as an existing command for your application will overwrite the old command.\n * @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command\n */\n createGlobalApplicationCommand(application_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>\n /**\n * Takes a list of application commands, overwriting the existing global command list for this application. Updates will be available in all guilds after 1 hour. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits.\n * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands\n */\n bulkOverwriteGlobalApplicationCommands(application_id: snowflake, data: ApplicationCommand.Params.Create[]): Promise<ApplicationCommand[]>\n /**\n * Fetch a global command for your application. Returns an application command object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command\n */\n getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /**\n * All parameters for this endpoint are optional.\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command\n */\n editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>\n /**\n * Deletes a global command. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command\n */\n deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>\n /**\n * Fetch all of the guild commands for your application for a specific guild. Returns an array of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands\n */\n getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>\n /**\n * Creating a command with the same name as an existing command for your application will overwrite the old command.\n * @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command\n */\n createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>\n /**\n * Takes a list of application commands, overwriting the existing command list for this application for the targeted guild. Returns 200 and a list of application command objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands\n */\n bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>\n /**\n * Fetches command permissions for all commands for your application in a guild. Returns an array of guild application command permissions objects.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions\n */\n getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand.GuildPermissions[]>\n /**\n * Fetch a guild command for your application. Returns an application command object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command\n */\n getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>\n /**\n * All parameters for this endpoint are optional.\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command\n */\n editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>\n /**\n * Delete a guild command. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command\n */\n deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>\n /**\n * Fetches command permissions for a specific command for your application in a guild. Returns a guild application command permissions object.\n * @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions\n */\n getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand.GuildPermissions>\n /**\n * This endpoint will overwrite existing permissions for the command in that guild\n * @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions\n */\n editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.EditPermissions): Promise<ApplicationCommand.GuildPermissions>\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 },\n '/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions': {\n GET: 'getApplicationCommandPermissions',\n PUT: 'editApplicationCommandPermissions',\n },\n})\n", "import { Channel, Emoji, integer } from '.'\n\nexport type Component = Button | SelectMenu | TextInput | ActionRow\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 /** A text input object */\n TEXT_INPUT = 4,\n /** Select menu for users */\n USER_SELECT = 5,\n /** Select menu for roles */\n ROLE_SELECT = 6,\n /** Select menu for mentionables (users and roles) */\n MENTIONABLE_SELECT = 7,\n /** Select menu for channels */\n CHANNEL_SELECT = 8,\n}\n\n/** https://discord.com/developers/docs/interactions/message-components#action-rows */\nexport interface ActionRow {\n type: ComponentType.ACTION_ROW\n components: Component[]\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: ComponentType.BUTTON\n /** one of button styles */\n style: ButtonStyles\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#button-object-button-styles */\nexport const enum ButtonStyles {\n /** blurple */\n PRIMARY = 1,\n /** grey */\n SECONDARY = 2,\n /** green */\n SUCCESS = 3,\n /** red */\n DANGER = 4,\n /** grey, navigates to a URL */\n LINK = 5,\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: ComponentType.SELECT_MENU | ComponentType.USER_SELECT | ComponentType.ROLE_SELECT | ComponentType.MENTIONABLE_SELECT | ComponentType.CHANNEL_SELECT\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 /** list of channel types to include in the channel select component (type 8) */\n channel_types?: Channel.Type[]\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\n/** @see https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure */\nexport interface TextInput {\n /** 4 for a text input */\n type: ComponentType.TEXT_INPUT\n /** a developer-defined identifier for the input, max 100 characters */\n custom_id: string\n /** the Text Input Style */\n style: TextInputStyles\n /** the label for this component, max 45 characters */\n label: string\n /** the minimum input length for a text input, min 0, max 4000 */\n min_length?: integer\n /** the maximum input length for a text input, min 1, max 4000 */\n max_length?: integer\n /** whether this component is required to be filled, default true */\n required?: boolean\n /** a pre-filled value for this component, max 4000 characters */\n value?: string\n /** custom placeholder text if the input is empty, max 100 characters */\n placeholder?: string\n}\n\n/** @see https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles */\nexport const enum TextInputStyles {\n /** A single-line input */\n SHORT = 1,\n /** A multi-line input */\n PARAGRAPH = 2,\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 { 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\nexport namespace Emoji {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update-guild-emojis-update-event-fields */\n export interface Update {\n /** id of the guild */\n guild_id: snowflake\n /** array of emojis */\n emojis: Emoji[]\n }\n }\n\n /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params */\n export interface CreateParams extends ModifyParams {\n /** the 128x128 emoji image */\n image: string\n }\n\n /** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji-json-params */\n export interface ModifyParams {\n /** name of the emoji */\n name?: string\n /** array of snowflakes roles allowed to use this emoji */\n roles?: snowflake[]\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild emojis were updated */\n GUILD_EMOJIS_UPDATE: Emoji.Event.Update\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of emoji objects for the given guild.\n * @see https://discord.com/developers/docs/resources/emoji#list-guild-emojis\n */\n listGuildEmojis(guild_id: snowflake): Promise<Emoji[]>\n /**\n * Returns an emoji object for the given guild and emoji IDs.\n * @see https://discord.com/developers/docs/resources/emoji#get-guild-emoji\n */\n getGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<Emoji>\n /**\n * Create a new emoji for the guild. Requires the `MANAGE_GUILD_EXPRESSIONS` permission. Returns the new emoji object on success. Fires a Guild Emojis Update Gateway event.\n * @see https://discord.com/developers/docs/resources/emoji#create-guild-emoji\n */\n createGuildEmoji(guild_id: snowflake, options: Emoji.CreateParams): Promise<Emoji>\n /**\n * Modify the given emoji. Requires the `MANAGE_GUILD_EXPRESSIONS` permission. Returns the updated emoji object on success. Fires a Guild Emojis Update Gateway event.\n * @see https://discord.com/developers/docs/resources/emoji#modify-guild-emoji\n */\n modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: Emoji.ModifyParams): Promise<Emoji>\n /**\n * Delete the given emoji. Requires the `MANAGE_GUILD_EXPRESSIONS` permission. Returns 204 No Content on success. Fires a Guild Emojis Update Gateway event.\n * @see https://discord.com/developers/docs/resources/emoji#delete-guild-emoji\n */\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", "import { Activity, integer, Internal, snowflake, StatusType } from '.'\n\nexport namespace Gateway {\n /** https://discord.com/developers/docs/topics/gateway-events#payload-structure */\n export interface PayloadStructure<O extends Opcode, 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\n export type Payload = {\n [O in Opcode]: O extends Opcode.DISPATCH\n ? {\n [T in keyof GatewayEvents]: PayloadStructure<Opcode.DISPATCH, T, GatewayEvents[T]>\n }[keyof GatewayEvents]\n : PayloadStructure<O, never, O extends keyof Params ? Params[O] : never>\n }[Opcode]\n\n /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */\n export enum Opcode {\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 */\n export enum Intent {\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 GUILDS = 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 * `MESSAGE_CONTENT` is a unique privileged intent that isn't directly associated with any Gateway events.\n * Instead, access to `MESSAGE_CONTENT` permits your app to receive message content data across the APIs.\n *\n * Any fields affected by the message content intent are noted in the relevant documentation.\n * For example, the content, embeds, attachments, and components fields in message objects all contain message content and therefore require the intent.\n *\n * Like other privileged intents, `MESSAGE_CONTENT` must be approved for your app.\n * After your app is verified, you can apply for the intent from your app's settings within the Developer Portal.\n * You can read more about the message content intent review policy in the [Help Center](https://support-dev.discord.com/hc/en-us/articles/5324827539479).\n *\n * Apps without the intent will receive empty values in fields that contain user-inputted content with a few exceptions:\n * - Content in messages that an app sends\n * - Content in DMs with the app\n * - Content in which the app is mentioned\n *\n * @see https://discord.com/developers/docs/topics/gateway#message-content-intent\n */\n MESSAGE_CONTENT = 1 << 15,\n /**\n * - GUILD_SCHEDULED_EVENT_CREATE\n * - GUILD_SCHEDULED_EVENT_UPDATE\n * - GUILD_SCHEDULED_EVENT_DELETE\n * - GUILD_SCHEDULED_EVENT_USER_ADD\n * - GUILD_SCHEDULED_EVENT_USER_REMOVE\n */\n GUILD_SCHEDULED_EVENTS = 1 << 16,\n /**\n * - AUTO_MODERATION_RULE_CREATE\n * - AUTO_MODERATION_RULE_UPDATE\n * - AUTO_MODERATION_RULE_DELETE\n */\n AUTO_MODERATION_CONFIGURATION = 1 << 20,\n /**\n * - AUTO_MODERATION_ACTION_EXECUTION\n */\n AUTO_MODERATION_EXECUTION = 1 << 21,\n }\n\n export interface Params {\n [Opcode.HELLO]: Params.Hello\n [Opcode.IDENTIFY]: Params.Identify\n [Opcode.RESUME]: Params.Resume\n [Opcode.REQUEST_GUILD_MEMBERS]: Params.RequestGuildMembers\n [Opcode.VOICE_STATE_UPDATE]: Params.VoiceStateUpdate\n [Opcode.PRESENCE_UPDATE]: Params.PresenceUpdate\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure */\n export interface Hello {\n /** the interval (in milliseconds) the client should heartbeat with */\n heartbeat_interval: integer\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure */\n export interface Identify {\n /** authentication token */\n token: string\n /** connection properties */\n properties: ConnectionProperties\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?: PresenceUpdate\n /** the Gateway Intents you wish to receive */\n intents: integer\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties */\n export interface ConnectionProperties {\n /** Your operating system */\n os: string\n /** Your library name */\n browser: string\n /** Your library name */\n device: string\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure */\n export interface Resume {\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-events#request-guild-members-guild-request-members-structure */\n export interface RequestGuildMembers {\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-events#update-voice-state-gateway-voice-state-update-structure */\n export interface VoiceStateUpdate {\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-events#update-presence-gateway-presence-update-structure */\n export interface PresenceUpdate {\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}\n\n/** https://discord.com/developers/docs/topics/gateway-events#gateway-events */\nexport interface GatewayEvents {}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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\n/** https://discord.com/developers/docs/topics/gateway#get-gateway-example-response */\nexport interface GetGatewayResponse {\n url: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot-json-response */\nexport interface GetGatewayBotResponse extends GetGatewayResponse {\n shards: integer\n session_start_limit: SessionStartLimit\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.\n * @see https://discord.com/developers/docs/topics/gateway#get-gateway\n */\n getGateway(): Promise<GetGatewayResponse>\n /**\n * Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike the Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds.\n * @see https://discord.com/developers/docs/topics/gateway#get-gateway-bot\n */\n getGatewayBot(): Promise<GetGatewayBotResponse>\n }\n}\n\nInternal.define({\n '/gateway': {\n GET: 'getGateway',\n },\n '/gateway/bot': {\n GET: 'getGatewayBot',\n },\n})\n", "import { Gateway, integer, Internal, 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 /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */\n communication_disabled_until?: timestamp\n}\n\nexport namespace GuildMember {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#list-guild-members-query-string-params */\n export interface List {\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\n /** https://discord.com/developers/docs/resources/guild#search-guild-members-query-string-params */\n export interface Search {\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\n /** https://discord.com/developers/docs/resources/guild#add-guild-member-json-params */\n export interface Add {\n /** an oauth2 access token granted with the guilds.join to the bot's application for the user you want to add to the guild */\n access_token: string\n /** value to set user's nickname to */\n nick: string\n /** array of role ids the member is assigned */\n roles: snowflake[]\n /** whether the user is muted in voice channels */\n mute: boolean\n /** whether the user is deafened in voice channels */\n deaf: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-member-json-params */\n export interface Modify {\n /** value to set user's nickname to */\n nick: string\n /** array of role ids the member is assigned */\n roles: snowflake[]\n /** whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel */\n mute: boolean\n /** whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel */\n deaf: boolean\n /** id of channel to move user to (if they are connected to voice) */\n channel_id: snowflake\n /** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout */\n communication_disabled_until?: timestamp\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-current-member-json-params */\n export interface ModifyCurrent {\n /** value to set user's nickname to */\n nick?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params */\n export interface GetPruneCount {\n /** number of days to count prune for (1-30) */\n days: integer\n /** role(s) to include */\n include_roles: string\n }\n\n /** https://discord.com/developers/docs/resources/guild#begin-guild-prune-json-params */\n export interface BeginPrune {\n /** number of days to prune (1-30) */\n days: integer\n /** whether 'pruned' is returned, discouraged for large guilds */\n compute_prune_count: boolean\n /** role(s) to include */\n include_roles: snowflake[]\n }\n }\n\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-member-add-guild-member-add-extra-fields */\n export interface Add extends GuildMember {\n /** id of the guild */\n guild_id: snowflake\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#guild-member-remove-guild-member-remove-event-fields */\n export interface Remove {\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-events#guild-member-update-guild-member-update-event-fields */\n export interface Update {\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 /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */\n communication_disabled_until?: timestamp\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk-guild-members-chunk-event-fields */\n export interface Chunk {\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?: Gateway.Params.PresenceUpdate[]\n /** the nonce used in the Guild Members Request */\n nonce?: string\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** new user joined a guild */\n GUILD_MEMBER_ADD: GuildMember.Event.Add\n /** user was removed from a guild */\n GUILD_MEMBER_REMOVE: GuildMember.Event.Remove\n /** guild member was updated */\n GUILD_MEMBER_UPDATE: GuildMember.Event.Update\n /** response to Request Guild Members */\n GUILD_MEMBERS_CHUNK: GuildMember.Event.Chunk\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a guild member object for the specified user.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-member\n */\n getGuildMember(guild_id: snowflake, user_id: snowflake): Promise<GuildMember>\n /**\n * Returns a list of guild member objects that are members of the guild.\n * @see https://discord.com/developers/docs/resources/guild#list-guild-members\n */\n listGuildMembers(guild_id: snowflake, params?: GuildMember.Params.List): Promise<GuildMember[]>\n /**\n * Returns a list of guild member objects whose username or nickname starts with a provided string.\n * @see https://discord.com/developers/docs/resources/guild#search-guild-members\n */\n searchGuildMembers(guild_id: snowflake, params?: GuildMember.Params.Search): Promise<GuildMember[]>\n /**\n * Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member of the guild. Fires a Guild Member Add Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#add-guild-member\n */\n addGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Add): Promise<void>\n /**\n * Modify attributes of a guild member. Returns a 200 OK with the guild member as the body. Fires a Guild Member Update Gateway event. If the channel_id is set to null, this will force the target user to be disconnected from voice.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-member\n */\n modifyGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Modify): Promise<void>\n /**\n * Modifies the current member in a guild. Returns a 200 with the updated member object on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-current-member\n */\n modifyCurrentMember(guild_id: snowflake, params: GuildMember.Params.ModifyCurrent): Promise<void>\n /**\n * Adds a role to a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#add-guild-member-role\n */\n addGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>\n /**\n * Removes a role from a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-member-role\n */\n removeGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>\n /**\n * Remove a member from a guild. Requires KICK_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Member Remove Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#remove-guild-member\n */\n removeGuildMember(guild_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count\n */\n getGuildPruneCount(guild_id: snowflake, params?: GuildMember.Params.GetPruneCount): Promise<void>\n /**\n * Begin a prune operation. Requires the KICK_MEMBERS permission. Returns an object with one 'pruned' key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to null. Fires multiple Guild Member Remove Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#begin-guild-prune\n */\n beginGuildPrune(guild_id: snowflake, params: GuildMember.Params.BeginPrune): Promise<void>\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/{user.id}/roles/{role.id}': {\n PUT: 'addGuildMemberRole',\n DELETE: 'removeGuildMemberRole',\n },\n '/guilds/{guild.id}/prune': {\n GET: 'getGuildPruneCount',\n POST: 'beginGuildPrune',\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\nexport namespace GuildTemplate {\n /** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template-json-params */\n export interface CreateGuildParams {\n /** name of the guild (2-100 characters) */\n name: string\n /** base64 128x128 image for the guild icon */\n icon?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-template#create-guild-template-json-params */\n export interface CreateParams {\n /** name of the template (1-100 characters) */\n name: string\n /** description for the template (0-120 characters) */\n description?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-template#modify-guild-template-json-params */\n export interface ModifyParams {\n /** name of the template (1-100 characters) */\n name?: string\n /** description for the template (0-120 characters) */\n description?: string\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a guild template object for the given code.\n * @see https://discord.com/developers/docs/resources/guild-template#get-guild-template\n */\n getGuildTemplate(code: string): Promise<GuildTemplate>\n /**\n * Create a new guild based on a template. Returns a guild object on success. Fires a Guild Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template\n */\n createGuildfromGuildTemplate(code: string, params: GuildTemplate.CreateGuildParams): Promise<Guild>\n /**\n * Returns an array of guild template objects. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild-template#get-guild-templates\n */\n getGuildTemplates(guild_id: snowflake): Promise<GuildTemplate[]>\n /**\n * Creates a template for the guild. Requires the MANAGE_GUILD permission. Returns the created guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#create-guild-template\n */\n createGuildTemplate(guild_id: snowflake, params: GuildTemplate.CreateParams): Promise<GuildTemplate>\n /**\n * Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#sync-guild-template\n */\n syncGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>\n /**\n * Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#modify-guild-template\n */\n modifyGuildTemplate(guild_id: snowflake, code: string, params: GuildTemplate.ModifyParams): Promise<GuildTemplate>\n /**\n * Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted guild template object on success.\n * @see https://discord.com/developers/docs/resources/guild-template#delete-guild-template\n */\n deleteGuildTemplate(guild_id: snowflake, code: string): Promise<GuildTemplate>\n }\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, Role, snowflake, Sticker, User } 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 /** 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 /** custom guild stickers */\n stickers?: Sticker[]\n /** whether the guild has the boost progress bar enabled */\n premium_progress_bar_enabled: boolean\n}\n\nexport namespace Guild {\n export namespace Event {\n export interface Create extends Guild {}\n\n export interface Update extends Guild {}\n\n export interface Delete extends Guild {}\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#get-current-user-guilds-query-string-params */\n export interface List {\n /** get guilds before this guild ID */\n before?: snowflake\n /** get guilds after this guild ID */\n after?: snowflake\n /** max number of guilds to return (1-200) */\n limit?: integer\n /** include approximate member and presence counts in response */\n with_counts?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#create-guild-json-params */\n export interface Create {\n /** name of the guild (2-100 characters) */\n name: string\n /** voice region id (deprecated) */\n region?: string\n /** base64 128x128 image for the guild icon */\n icon?: string\n /** verification level */\n verification_level?: integer\n /** default message notification level */\n default_message_notifications?: integer\n /** explicit content filter level */\n explicit_content_filter?: integer\n /** new guild roles */\n roles?: Role[]\n /** new guild's channels */\n channels?: Partial<Channel>[]\n /** id for afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout?: integer\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 }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-query-string-params */\n export interface Get {\n /** when true, will return approximate member and presence counts for the guild */\n with_counts?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-json-params */\n export interface Modify {\n /** guild name */\n name: string\n /** guild voice region id (deprecated) */\n region?: string\n /** verification level */\n verification_level?: integer\n /** default message notification level */\n default_message_notifications?: integer\n /** explicit content filter level */\n explicit_content_filter?: integer\n /** id for afk channel */\n afk_channel_id?: snowflake\n /** afk timeout in seconds */\n afk_timeout: integer\n /** base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) */\n icon?: string\n /** user id to transfer guild ownership to (must be owner) */\n owner_id: snowflake\n /** base64 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) */\n splash?: string\n /** base64 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) */\n discovery_splash?: string\n /** base64 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature) */\n banner?: string\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 display rules and/or guidelines */\n rules_channel_id?: snowflake\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 preferred locale of a Community guild used in server discovery and notices from Discord; defaults to \"en-US\" */\n preferred_locale?: string\n /** enabled guild features */\n features: GuildFeature[]\n /** the description for the guild, if the guild is discoverable */\n description?: string\n /** whether the guild's boost progress bar should be enabled. */\n premium_progress_bar_enabled: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-query-string-params */\n export interface GetWidgetImage {\n /** style of the widget image returned (see below) */\n style: WidgetStyleOptions\n }\n\n /** https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options */\n export enum WidgetStyleOptions {\n /** shield style widget with Discord icon and guild members online count */\n shield = 'shield',\n /** large image with guild icon, name and online count. \"POWERED BY DISCORD\" as the footer of the widget */\n banner1 = 'banner1',\n /** smaller widget style with guild icon, name and online count. Split on the right with Discord logo */\n banner2 = 'banner2',\n /** large image with guild icon, name and online count. In the footer, Discord logo on the left and \"Chat Now\" on the right */\n banner3 = 'banner3',\n /** large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget and a \"JOIN MY SERVER\" button at the bottom */\n banner4 = 'banner4',\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen-json-params */\n export interface ModifyWelcomeScreen {\n /** whether the welcome screen is enabled */\n enabled: boolean\n /** channels linked in the welcome screen and their display options */\n welcome_channels: WelcomeScreenChannel[]\n /** the server description to show in the welcome screen */\n description: string\n }\n }\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 /** Hide member join sticker reply buttons */\n SUPPRESS_JOIN_NOTIFICATION_REPLIES = 1 << 3,\n /** Suppress role subscription purchase and renewal notifications */\n SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS = 1 << 4,\n /** Hide role subscription sticker reply buttons */\n SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES = 1 << 5\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 /** custom guild stickers */\n stickers: Sticker[]\n}\n\n/** https://discord.com/developers/docs/resources/guild#guild-widget-object-guild-widget-structure */\nexport interface GuildWidget {\n /** guild id */\n id: snowflake\n /** guild name (2-100 characters) */\n name: string\n /** instant invite for the guilds specified widget invite channel */\n instant_invite?: string\n /** voice and stage channels which are accessible by everyone */\n channels: Partial<Channel>[]\n /** special widget user objects that includes users presence (Limit 100) */\n members: Partial<User>[]\n /** number of online members in this guild */\n presence_count: integer\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\ndeclare module './gateway' {\n interface GatewayEvents {\n /** lazy-load for unavailable guild, guild became available, or user joined a new guild */\n GUILD_CREATE: Guild.Event.Create\n /** guild was updated */\n GUILD_UPDATE: Guild.Event.Update\n /** guild became unavailable, or user left/was removed from a guild */\n GUILD_DELETE: Guild.Event.Delete\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-current-user-guilds\n */\n getCurrentUserGuilds(params?: Guild.Params.List): Promise<Guild[]>\n /**\n * Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-current-user-guild-member\n */\n getCurrentUserGuildMember(guild_id: snowflake): Promise<GuildMember>\n /**\n * Leave a guild. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/user#leave-guild\n */\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}/member': {\n GET: 'getCurrentUserGuildMember',\n },\n '/users/@me/guilds/{guild.id}': {\n DELETE: 'leaveGuild',\n },\n})\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#create-guild\n */\n createGuild(params: Guild.Params.Create): Promise<Guild>\n /**\n * Returns the guild object for the given id. If with_counts is set to true, this endpoint will also return approximate_member_count and approximate_presence_count for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild\n */\n getGuild(guild_id: snowflake, params?: Guild.Params.Get): Promise<Guild>\n /**\n * Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-preview\n */\n getGuildPreview(guild_id: snowflake): Promise<GuildPreview>\n /**\n * Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild\n */\n modifyGuild(guild_id: snowflake, params: Guild.Params.Modify): Promise<void>\n /**\n * Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild\n */\n deleteGuild(guild_id: snowflake): Promise<void>\n /**\n * Returns a guild widget object. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget-settings\n */\n getGuildWidgetSettings(guild_id: snowflake): Promise<GuildWidget>\n /**\n * Modify a guild widget object for the guild. All attributes may be passed in with JSON and modified. Requires the MANAGE_GUILD permission. Returns the updated guild widget object.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-widget\n */\n modifyGuildWidget(guild_id: snowflake, params: Partial<GuildWidget>): Promise<GuildWidget>\n /**\n * Returns the widget for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget\n */\n getGuildWidget(guild_id: snowflake): Promise<any>\n /**\n * Returns a PNG image widget for the guild. Requires no permissions or authentication.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-widget-image\n */\n getGuildWidgetImage(guild_id: snowflake, params?: Guild.Params.GetWidgetImage): Promise<any>\n /**\n * Returns the Welcome Screen object for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen\n */\n getGuildWelcomeScreen(guild_id: snowflake): Promise<WelcomeScreen>\n /**\n * Modify the guild's Welcome Screen. Requires the MANAGE_GUILD permission. Returns the updated Welcome Screen object.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen\n */\n modifyGuildWelcomeScreen(guild_id: snowflake, params: Guild.Params.ModifyWelcomeScreen): Promise<WelcomeScreen>\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}/widget': {\n GET: 'getGuildWidgetSettings',\n PATCH: 'modifyGuildWidget',\n },\n '/guilds/{guild.id}/widget.json': {\n GET: 'getGuildWidget',\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})\n", "import { integer, Internal, 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 /** the scopes the application has been authorized for */\n scopes?: string[]\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 bot associated with this application */\n bot?: User\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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-events#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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of integration objects for the guild. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-integrations\n */\n getGuildIntegrations(guild_id: snowflake): Promise<Integration[]>\n /**\n * Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild-integration\n */\n deleteGuildIntegration(guild_id: snowflake, integration_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/integrations': {\n GET: 'getGuildIntegrations',\n },\n '/guilds/{guild.id}/integrations/{integration.id}': {\n DELETE: 'deleteGuildIntegration',\n },\n})\n", "import { AllowedMentions, ApplicationCommand, Attachment, Channel, Component, ComponentType, Embed, GuildMember, integer, Internal, Message, Role, snowflake, User } from '.'\nimport * as Discord 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: Interaction.Type\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 /** bitwise set of permissions the app or bot has within the channel the interaction was sent from */\n app_permissions?: string\n /** selected language of the invoking user */\n locale?: string\n /** guild's preferred locale, if invoked in a guild */\n guild_locale?: string\n}\n\nexport type InteractionData =\n | InteractionData.ApplicationCommand\n | InteractionData.MessageComponent\n | InteractionData.ModalSubmit\n\nexport namespace InteractionData {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-data-structure */\n export interface ApplicationCommand {\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?: ApplicationCommand.Option[]\n /** the id of the guild the command is registered to */\n guild_id?: snowflake\n /** id of the user or message targeted by a user or message command */\n target_id?: snowflake\n }\n\n export namespace ApplicationCommand {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-application-command-interaction-data-option-structure */\n export interface Option {\n /** the name of the parameter */\n name: string\n /** value of application command option type */\n type: Discord.ApplicationCommand.OptionType\n /** the value of the pair */\n value?: any\n /** present if this option is a group or subcommand */\n options?: Option[]\n /** true if this option is the currently focused option for autocomplete */\n focused?: boolean\n }\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-message-component-data-structure */\n export interface MessageComponent {\n /** the custom_id of the component */\n custom_id: string\n /** the type of the component */\n component_type: ComponentType\n /** values the user selected in a select menu component */\n values?: string[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */\n export interface ModalSubmit {\n custom_id: string\n components: Component[]\n }\n}\n\nexport namespace Interaction {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type */\n export enum Type {\n PING = 1,\n APPLICATION_COMMAND = 2,\n MESSAGE_COMPONENT = 3,\n APPLICATION_COMMAND_AUTOCOMPLETE = 4,\n MODAL_SUBMIT = 5,\n }\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 /** the ids and attachment objects */\n attachments?: Record<snowflake, Attachment>\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: Interaction.Type\n /** the name of the application command */\n name: string\n /** the user who invoked the interaction */\n user: User\n /** member who invoked the interaction in the guild */\n member?: Partial<GuildMember>\n}\n\nexport namespace Interaction {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-response-structure */\n export interface Response {\n /** the type of response */\n type: CallbackType\n /** an optional response message */\n data?: CallbackData\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */\n export enum CallbackType {\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 /**\n * for components, ACK an interaction and edit the original message later; the user does not see a loading state\n * (only valid for [component-based](https://discord.com/developers/docs/interactions/message-components) interactions)\n */\n DEFERRED_UPDATE_MESSAGE = 6,\n /**\n * for components, edit the message the component was attached to\n * (only valid for [component-based](https://discord.com/developers/docs/interactions/message-components) interactions)\n */\n UPDATE_MESSAGE = 7,\n /** respond to an autocomplete interaction with suggested choices */\n APPLICATION_COMMAND_AUTOCOMPLETE_RESULT = 8,\n /**\n * respond to an interaction with a popup modal\n * (not available for `MODAL_SUBMIT` and `PING` interactions)\n */\n MODAL = 9,\n }\n\n export type CallbackData =\n | CallbackData.Messages\n | CallbackData.Autocomplete\n | CallbackData.Modal\n\n export namespace CallbackData {\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages */\n export interface Messages {\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 /** attachment objects with filename and description */\n attachments?: Partial<Attachment>[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-autocomplete */\n export interface Autocomplete {\n /** autocomplete choices (max of 25 choices) */\n choices: ApplicationCommand.OptionChoice[]\n }\n\n /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal */\n export interface Modal {\n /** a developer-defined identifier for the modal, max 100 characters */\n custom_id: string\n /** the title of the popup modal, max 45 characters */\n title: string\n /** between 1 and 5 (inclusive) components that make up the modal */\n components: Component[]\n }\n }\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\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a response to an Interaction from the gateway. Takes an interaction response. This endpoint also supports file attachments similar to the webhook endpoints. Refer to Uploading Files for details on uploading files and multipart/form-data requests.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response\n */\n createInteractionResponse(interaction_id: snowflake, token: string, params: Interaction.Response): Promise<void>\n /**\n * Returns the initial Interaction response. Functions the same as Get Webhook Message.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response\n */\n getOriginalInteractionResponse(application_id: snowflake, token: string): Promise<Interaction.Response>\n /**\n * Edits the initial Interaction response. Functions the same as Edit Webhook Message.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response\n */\n editOriginalInteractionResponse(application_id: snowflake, token: string): Promise<Interaction.Response>\n /**\n * Deletes the initial Interaction response. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response\n */\n deleteOriginalInteractionResponse(application_id: snowflake, token: string): Promise<void>\n /**\n * Create a followup message for an Interaction. Functions the same as Execute Webhook, but wait is always true, and flags can be set to 64 in the body to send an ephemeral message. The thread_id, avatar_url, and username parameters are not supported when using this endpoint for interaction followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message\n */\n createFollowupMessage(application_id: snowflake, token: string): Promise<any>\n /**\n * Returns a followup message for an Interaction. Functions the same as Get Webhook Message. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message\n */\n getFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<any>\n /**\n * Edits a followup message for an Interaction. Functions the same as Edit Webhook Message. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message\n */\n editFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<any>\n /**\n * Deletes a followup message for an Interaction. Returns 204 No Content on success. Does not support ephemeral followups.\n * @see https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message\n */\n deleteFollowupMessage(application_id: snowflake, token: string, message_id: snowflake): Promise<void>\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, GuildScheduledEvent, 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?: Invite.TargetType\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?: Invite.StageInstance\n /** guild scheduled event data, only included if guild_scheduled_event_id contains a valid guild scheduled event id */\n guild_scheduled_event?: GuildScheduledEvent\n}\n\nexport namespace Invite {\n /** https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */\n export enum TargetType {\n STREAM = 1,\n EMBEDDED_APPLICATION = 2,\n }\n\n /** https://discord.com/developers/docs/resources/invite#invite-metadata-object-invite-metadata-structure */\n export interface Metadata extends Invite {\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 */\n export interface StageInstance {\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 export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#invite-create-invite-create-event-fields */\n export interface Create {\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-events#invite-delete-invite-delete-event-fields */\n export interface Delete {\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 }\n\n /** https://discord.com/developers/docs/resources/invite#get-invite-query-string-params */\n export interface GetOptions {\n /** whether to include invite metadata */\n with_counts?: boolean\n /** whether to include invite expiration date */\n with_expiration?: boolean\n /** the guild scheduled event to include with the invite */\n guild_scheduled_event_id?: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/channel#create-channel-invite-json-params */\n export interface CreateParams {\n /** duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days) */\n max_age: integer\n /** max number of uses or 0 for unlimited. between 0 and 100 */\n max_uses: integer\n /** whether this invite only grants temporary membership */\n temporary: boolean\n /** if true, don't try to reuse a similar invite (useful for creating many unique one time use invites) */\n unique: boolean\n /** the type of target for this voice channel invite */\n target_type: integer\n /** the id of the user whose stream to display for this invite, required if target_type is 1, the user must be streaming in the channel */\n target_user_id: snowflake\n /** the id of the embedded application to open for this invite, required if target_type is 2, the application must have the EMBEDDED flag */\n target_application_id: snowflake\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** invite to a channel was created */\n INVITE_CREATE: Invite.Event.Create\n /** invite to a channel was deleted */\n INVITE_DELETE: Invite.Event.Delete\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns an invite object for the given code.\n * @see https://discord.com/developers/docs/resources/invite#get-invite\n */\n getInvite(code: string, params?: Invite.GetOptions): Promise<Invite>\n /**\n * Delete an invite. Requires the MANAGE_CHANNELS permission on the channel this invite belongs to, or MANAGE_GUILD to remove any invite across the guild. Returns an invite object on success. Fires a Invite Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/invite#delete-invite\n */\n deleteInvite(code: string): Promise<Invite>\n /**\n * Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD permission.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-invites\n */\n getGuildInvites(guild_id: snowflake): Promise<Invite.Metadata[]>\n /**\n * Returns a partial invite object for guilds with that feature enabled. Requires the MANAGE_GUILD permission. code will be null if a vanity url for the guild is not set.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-vanity-url\n */\n getGuildVanityURL(guild_id: snowflake): Promise<Partial<Invite>>\n /**\n * Returns a list of invite objects (with invite metadata) for the channel. Only usable for guild channels. Requires the MANAGE_CHANNELS permission.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-invites\n */\n getChannelInvites(channel_id: string): Promise<Invite.Metadata[]>\n /**\n * Create a new invite object for the channel. Only usable for guild channels. Requires the CREATE_INSTANT_INVITE permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object ({}). Returns an invite object. Fires an Invite Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#create-channel-invite\n */\n createChannelInvite(channel_id: string, params: Invite.CreateParams): Promise<void>\n }\n}\n\nInternal.define({\n '/invites/{invite.code}': {\n GET: 'getInvite',\n DELETE: 'deleteInvite',\n },\n '/guilds/{guild.id}/invites': {\n GET: 'getGuildInvites',\n },\n '/guilds/{guild.id}/vanity-url': {\n GET: 'getGuildVanityURL',\n },\n '/channels/{channel.id}/invites': {\n GET: 'getChannelInvites',\n POST: 'createChannelInvite',\n },\n})\n", "import { AllowedMentions, Application, Channel, Component, GuildMember, integer, Internal, MessageInteraction, Reaction, RoleSubscriptionData, snowflake, Sticker, 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 /** 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: Message.Type\n /** sent with Rich Presence-related chat embeds */\n activity?: Message.Activity\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?: Message.Reference\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?: Sticker.Item[]\n /** a generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with total_message_sent on parent thread */\n position?: integer\n /** data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message */\n role_subscription_data?: RoleSubscriptionData\n}\n\nexport namespace Message {\n /** https://discord.com/developers/docs/resources/channel#message-object-message-types */\n export enum Type {\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 AUTO_MODERATION_ACTION = 24,\n ROLE_SUBSCRIPTION_PURCHASE = 25,\n INTERACTION_PREMIUM_UPSELL = 26,\n GUILD_APPLICATION_PREMIUM_SUBSCRIPTION = 32,\n }\n\n /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */\n export interface Activity {\n /** type of message activity */\n type: ActivityType\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 */\n export enum ActivityType {\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 */\n export enum Flag {\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 /** this message failed to mention some roles and add their members to the thread */\n FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8,\n }\n\n /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */\n export interface Reference {\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#get-channel-messages-query-string-params */\n export interface GetParams {\n /** get messages around this message ID */\n around?: snowflake\n /** get messages before this message ID */\n before?: snowflake\n /** get messages after this message ID */\n after?: snowflake\n /** max number of messages to return (1-100) */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#create-message-jsonform-params */\n export interface CreateParams extends EditParams {\n /** true if this is a TTS message */\n tts: boolean\n /** include to make your message a reply */\n message_reference: Reference\n /** IDs of up to 3 stickers in the server to send in the message */\n sticker_ids: snowflake[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#edit-message-jsonform-params */\n export interface EditParams {\n /** the message contents (up to 2000 characters) */\n content?: string\n /** embedded rich content (up to 6000 characters) */\n embeds?: Embed[]\n /** edit the flags of a message (only SUPPRESS_EMBEDS can currently be set/unset) */\n flags?: integer\n /** allowed mentions for the message */\n allowed_mentions?: AllowedMentions\n /** the components to include with the message */\n components?: Component[]\n /** the contents of the file being sent/edited */\n files?: any\n /** JSON encoded body of non-file params (multipart/form-data only) */\n payload_json?: string\n /** attached files to keep and possible descriptions for new files */\n attachments?: Attachment[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#bulk-delete-messages-json-params */\n export interface BulkDeleteParams {\n /** an array of message ids to delete (2-100) */\n messages: snowflake[]\n }\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?: Embed.Footer\n /** image information */\n image?: Embed.Image\n /** thumbnail information */\n thumbnail?: Embed.Thumbnail\n /** video information */\n video?: Embed.Video\n /** provider information */\n provider?: Embed.Provider\n /** author information */\n author?: Embed.Author\n /** fields information */\n fields?: Embed.Field[]\n}\n\nexport namespace Embed {\n /** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */\n export interface Thumbnail {\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 */\n export interface Video {\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 */\n export interface Image {\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 */\n export interface Provider {\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 */\n export interface Author {\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 */\n export interface Footer {\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 */\n export interface Field {\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\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: Channel.Type\n /** the name of the channel */\n name: string\n}\n\nexport namespace Message {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#message-create */\n export interface Create extends Message {\n /** ID of the guild the message was sent in - unless it is an ephemeral message */\n guild_id?: snowflake\n /** Member properties for this message's author. Missing for ephemeral messages and messages from webhooks */\n member?: Partial<GuildMember>\n /** Users specifically mentioned in the message */\n mentions: (User & { member: Partial<GuildMember> })[]\n }\n\n /** https://discord.com/developers/docs/topics/gateway-events#message-update */\n export interface Update extends Partial<Message> {}\n\n /** https://discord.com/developers/docs/topics/gateway-events#message-delete-message-delete */\n export interface Delete {\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-events#message-delete-bulk-message-delete-bulk */\n export interface DeleteBulk {\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 }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** message was created */\n MESSAGE_CREATE: Message.Event.Create\n /** message was edited */\n MESSAGE_UPDATE: Message.Event.Update\n /** message was deleted */\n MESSAGE_DELETE: Message.Event.Delete\n /** multiple messages were deleted at once */\n MESSAGE_DELETE_BULK: Message.Event.DeleteBulk\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the messages for a channel. If operating on a guild channel, this endpoint requires the VIEW_CHANNEL permission to be present on the current user. If the current user is missing the 'READ_MESSAGE_HISTORY' permission in the channel then this will return no messages (since they cannot read the message history). Returns an array of message objects on success.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-messages\n */\n getChannelMessages(channel_id: snowflake, params?: Message.GetParams): Promise<Message[]>\n /**\n * Returns a specific message in the channel. If operating on a guild channel, this endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/channel#get-channel-message\n */\n getChannelMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /**\n * Post a message to a guild text or DM channel. Returns a message object. Fires a Message Create Gateway event. See message formatting for more information on how to properly format messages.\n * @see https://discord.com/developers/docs/resources/channel#create-message\n */\n createMessage(channel_id: snowflake, params: Message.CreateParams): Promise<Message>\n /**\n * Crosspost a message in a News Channel to following channels. This endpoint requires the 'SEND_MESSAGES' permission, if the current user sent the message, or additionally the 'MANAGE_MESSAGES' permission, for all other messages, to be present for the current user.\n * @see https://discord.com/developers/docs/resources/channel#crosspost-message\n */\n crosspostMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>\n /**\n * Edit a previously sent message. The fields content, embeds, and flags can be edited by the original message author. Other users can only edit flags and only if they have the MANAGE_MESSAGES permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only flags documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).\n * @see https://discord.com/developers/docs/resources/channel#edit-message\n */\n editMessage(channel_id: snowflake, message_id: snowflake, params: Message.EditParams): Promise<Message>\n /**\n * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#delete-message\n */\n deleteMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Bulk Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#bulk-delete-messages\n */\n bulkDeleteMessages(channel_id: snowflake, params: Message.BulkDeleteParams): Promise<void>\n /**\n * Returns all pinned messages in the channel as an array of message objects.\n * @see https://discord.com/developers/docs/resources/channel#get-pinned-messages\n */\n getPinnedMessages(channel_id: snowflake): Promise<Message[]>\n /**\n * Pin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/channel#pin-message\n */\n pinMessage(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Unpin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.\n * @see https://discord.com/developers/docs/resources/channel#unpin-message\n */\n unpinMessage(channel_id: snowflake, message_id: 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 '/channels/{channel.id}/pins': {\n GET: 'getPinnedMessages',\n },\n '/channels/{channel.id}/pins/{message.id}': {\n PUT: 'pinMessage',\n DELETE: 'unpinMessage',\n },\n})\n", "import { Emoji, integer, snowflake, User } from '.'\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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 /** Offline */\n OFFLINE = 'OFFLINE',\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#activity-object-activity-structure */\nexport interface Activity {\n /** the activity's name */\n name: string\n /** activity type */\n type: ActivityType\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-events#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-events#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-events#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-events#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-events#activity-object-activity-secrets */\nexport interface ActivitySecrets {\n /** Secret for joining a party */\n join?: string\n /** Secret for spectating a game */\n spectate?: string\n /** Secret for a specific instanced match */\n match?: string\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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 PARTY_PRIVACY_FRIENDS = 1 << 6,\n PARTY_PRIVACY_VOICE_CHANNEL= 1 << 7,\n EMBEDDED = 1 << 8,\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user was updated */\n PRESENCE_UPDATE: PresenceUpdateEvent\n }\n}\n", "import { Emoji, GuildMember, integer, Internal, snowflake, User } from '.'\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\nexport namespace Reaction {\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#message-reaction-add-message-reaction-add-event-fields */\n export interface Add {\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-events#message-reaction-remove-message-reaction-remove-event-fields */\n export interface Remove {\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-events#message-reaction-remove-all-message-reaction-remove-all-event-fields */\n export interface RemoveAll {\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-events#message-reaction-remove-emoji-message-reaction-remove-emoji */\n export interface RemoveEmoji {\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 }\n\n export interface GetParams {\n /** get users after this user ID */\n after?: snowflake\n /** max number of users to return (1-100) */\n limit?: integer\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** user reacted to a message */\n MESSAGE_REACTION_ADD: Reaction.Event.Add\n /** user removed a reaction from a message */\n MESSAGE_REACTION_REMOVE: Reaction.Event.Remove\n /** all reactions were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_ALL: Reaction.Event.RemoveAll\n /** all reactions for a given emoji were explicitly removed from a message */\n MESSAGE_REACTION_REMOVE_EMOJI: Reaction.Event.RemoveEmoji\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#create-reaction\n */\n createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /**\n * Delete a reaction the current user has made for the message. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-own-reaction\n */\n deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>\n /**\n * Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-user-reaction\n */\n deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>\n /**\n * Get a list of users that reacted with this emoji. Returns an array of user objects on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#get-reactions\n */\n getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, params?: Reaction.GetParams): Promise<User[]>\n /**\n * Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Fires a Message Reaction Remove All Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions\n */\n deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>\n /**\n * Deletes all the reactions for a given emoji on a message. This endpoint requires the MANAGE_MESSAGES permission to be present on the current user. Fires a Message Reaction Remove Emoji Gateway event. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.\n * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji\n */\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 { integer, Internal, 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 /** Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels */\n MODERATE_MEMBERS = 1 << 40,\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\nexport namespace Role {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#create-guild-role-json-params */\n export interface Create {\n /** name of the role */\n name?: string\n /** bitwise value of the enabled/disabled permissions */\n permissions?: string\n /** RGB color value */\n color?: integer\n /** whether the role should be displayed separately in the sidebar */\n hoist?: boolean\n /** the role's icon image (if the guild has the ROLE_ICONS feature) */\n icon?: string\n /** the role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) */\n unicode_emoji?: string\n /** whether the role should be mentionable */\n mentionable?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions-json-params */\n export interface ModifyPositions {\n /** role */\n id: snowflake\n /** sorting position of the role */\n position?: integer\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-guild-role-json-params */\n export interface Modify {\n /** name of the role */\n name?: string\n /** bitwise value of the enabled/disabled permissions */\n permissions?: string\n /** RGB color value */\n color?: integer\n /** whether the role should be displayed separately in the sidebar */\n hoist?: boolean\n /** the role's icon image (if the guild has the ROLE_ICONS feature) */\n icon?: string\n /** the role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) */\n unicode_emoji?: string\n /** whether the role should be mentionable */\n mentionable?: boolean\n }\n }\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 /** the id of this role's subscription sku and listing */\n subscription_listing_id?: snowflake\n /** whether this role is available for purchase */\n available_for_purchase?: null\n /** whether this role is a guild's linked role */\n guild_connections?: null\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of role objects for the guild.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-roles\n */\n getGuildRoles(guild_id: snowflake): Promise<Role[]>\n /**\n * Create a new role for the guild. Requires the MANAGE_ROLES permission. Returns the new role object on success. Fires a Guild Role Create Gateway event. All JSON params are optional.\n * @see https://discord.com/developers/docs/resources/guild#create-guild-role\n */\n createGuildRole(guild_id: snowflake, param: Role.Params.Create): Promise<Role>\n /**\n * Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES permission. Returns a list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-role-positions\n */\n modifyGuildRolePositions(guild_id: snowflake, param: Role.Params.ModifyPositions): Promise<Role[]>\n /**\n * Modify a guild role. Requires the MANAGE_ROLES permission. Returns the updated role on success. Fires a Guild Role Update Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#modify-guild-role\n */\n modifyGuildRole(guild_id: snowflake, role_id: snowflake, param: Role.Params.Modify): Promise<Role>\n /**\n * Delete a guild role. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Role Delete Gateway event.\n * @see https://discord.com/developers/docs/resources/guild#delete-guild-role\n */\n deleteGuildRole(guild_id: snowflake, role_id: snowflake): Promise<void>\n }\n}\n\nInternal.define({\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})\n", "import { GuildMember, integer, Internal, snowflake, timestamp, User } from '.'\n\n/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */\nexport interface GuildScheduledEvent {\n /** the id of the scheduled event */\n id: snowflake\n /** the guild id which the scheduled event belongs to */\n guild_id: snowflake\n /** the channel id in which the scheduled event will be hosted, or null if scheduled entity type is EXTERNAL */\n channel_id?: snowflake\n /** the id of the user that created the scheduled event * */\n creator_id?: snowflake\n /** the name of the scheduled event (1-100 characters) */\n name: string\n /** the description of the scheduled event (1-1000 characters) */\n description?: string\n /** the time the scheduled event will start */\n scheduled_start_time: timestamp\n /** the time the scheduled event will end, required if entity_type is EXTERNAL */\n scheduled_end_time?: timestamp\n /** the privacy level of the scheduled event */\n privacy_level: GuildScheduledEvent.PrivacyLevel\n /** the status of the scheduled event */\n status: GuildScheduledEvent.Status\n /** the type of the scheduled event */\n entity_type: GuildScheduledEvent.EntityType\n /** the id of an entity associated with a guild scheduled event */\n entity_id?: snowflake\n /** additional metadata for the guild scheduled event */\n entity_metadata?: GuildScheduledEvent.EntityMetadata\n /** the user that created the scheduled event */\n creator?: User\n /** the number of users subscribed to the scheduled event */\n user_count?: integer\n /** the cover image hash of the scheduled event */\n image?: string\n}\n\nexport namespace GuildScheduledEvent {\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level */\n export enum PrivacyLevel {\n /** the scheduled event is only accessible to guild members */\n GUILD_ONLY = 2,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types */\n export enum EntityType {\n STAGE_INSTANCE = 1,\n VOICE = 2,\n EXTERNAL = 3,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status */\n export enum Status {\n SCHEDULED = 1,\n ACTIVE = 2,\n COMPLETED = 3,\n CANCELLED = 4,\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata */\n export interface EntityMetadata {\n /** location of the event (1-100 characters) */\n location?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild-query-string-params */\n export interface ListParams {\n /** include number of users subscribed to each event */\n with_user_count?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event-json-params */\n export interface CreateParams {\n /** the channel id of the scheduled event. */\n channel_id?: snowflake\n /** the entity metadata of the scheduled event */\n entity_metadata?: EntityMetadata\n /** the name of the scheduled event */\n name: string\n /** the privacy level of the scheduled event */\n privacy_level: PrivacyLevel\n /** the time to schedule the scheduled event */\n scheduled_start_time: timestamp\n /** the time when the scheduled event is scheduled to end */\n scheduled_end_time?: timestamp\n /** the description of the scheduled event */\n description?: string\n /** the entity type of the scheduled event */\n entity_type: EntityType\n /** the cover image of the scheduled event */\n image?: string\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-query-string-params */\n export interface GetParams {\n /** include number of users subscribed to this event */\n with_user_count?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event-json-params */\n export interface ModifyParams {\n /** the channel id of the scheduled event, set to null if changing entity type to EXTERNAL */\n channel_id?: snowflake\n /** the entity metadata of the scheduled event */\n entity_metadata?: EntityMetadata\n /** the name of the scheduled event */\n name?: string\n /** the privacy level of the scheduled event */\n privacy_level?: PrivacyLevel\n /** the time to schedule the scheduled event */\n scheduled_start_time?: timestamp\n /** the time when the scheduled event is scheduled to end */\n scheduled_end_time?: timestamp\n /** the description of the scheduled event */\n description?: string\n /** the entity type of the scheduled event */\n entity_type?: EntityType\n /** the status of the scheduled event */\n status?: Status\n /** the cover image of the scheduled event */\n image?: string\n }\n}\n\n/** https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure */\nexport interface GuildScheduledEventUser {\n /** the scheduled event id which the user subscribed to */\n guild_scheduled_event_id: snowflake\n /** user which subscribed to an event */\n user: User\n /** guild member data for this user for the guild which this event belongs to, if any */\n member?: GuildMember\n}\n\nexport namespace GuildScheduledEventUser {\n /** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users-query-string-params */\n export interface GetParams {\n /** number of users to return (up to maximum 100) */\n limit?: number\n /** include guild member data if it exists */\n with_member?: boolean\n /** consider only users before given user id */\n before?: snowflake\n /** consider only users after given user id */\n after?: snowflake\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a list of guild scheduled event objects for the given guild.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild\n */\n listScheduledEventsforGuild(guildId: snowflake, params?: GuildScheduledEvent.ListParams): Promise<GuildScheduledEvent[]>\n /**\n * Create a guild scheduled event in the guild. Returns a guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event\n */\n createGuildScheduledEvent(guildId: snowflake, params: GuildScheduledEvent.CreateParams): Promise<GuildScheduledEvent>\n /**\n * Get a guild scheduled event. Returns a guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event\n */\n getGuildScheduledEvent(guildId: snowflake, eventId: snowflake, params?: GuildScheduledEvent.GetParams): Promise<GuildScheduledEvent>\n /**\n * Modify a guild scheduled event. Returns the modified guild scheduled event object on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event\n */\n modifyGuildScheduledEvent(guildId: snowflake, eventId: snowflake, params: GuildScheduledEvent.ModifyParams): Promise<GuildScheduledEvent>\n /**\n * Delete a guild scheduled event. Returns a 204 on success.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event\n */\n deleteGuildScheduledEvent(guildId: snowflake, eventId: snowflake): Promise<void>\n /**\n * Get a list of guild scheduled event users subscribed to a guild scheduled event.\n * Returns a list of guild scheduled event user objects on success.\n * Guild member data, if it exists, is included if the with_member query parameter is set.\n * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users\n */\n getGuildScheduledEventUsers(guildId: snowflake, eventId: snowflake, params?: GuildScheduledEventUser.GetParams): Promise<GuildScheduledEventUser[]>\n }\n}\n\nInternal.define({\n '/guilds/{guild.id}/scheduled-events': {\n GET: 'listScheduledEventsforGuild',\n POST: 'createGuildScheduledEvent',\n },\n '/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}': {\n GET: 'getGuildScheduledEvent',\n PATCH: 'modifyGuildScheduledEvent',\n DELETE: 'deleteGuildScheduledEvent',\n },\n '/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}/users': {\n GET: 'getGuildScheduledEventUsers',\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 /** The id of the scheduled event for this Stage instance */\n guild_scheduled_event_id?: snowflake\n}\n\nexport namespace StageInstance {\n export namespace Event {\n export interface Create extends StageInstance {}\n\n export interface Delete extends StageInstance {}\n\n export interface Update extends StageInstance {}\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance-json-params */\n export interface Create {\n /** The id of the 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 (default GUILD_ONLY) */\n privacy_level?: integer\n /** Notify @everyone that a Stage instance has started */\n send_start_notification?: boolean\n }\n\n /** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance-json-params */\n export interface Modify {\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 }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** stage instance was created */\n STAGE_INSTANCE_CREATE: StageInstance.Event.Create\n /** stage instance was deleted or closed */\n STAGE_INSTANCE_DELETE: StageInstance.Event.Delete\n /** stage instance was updated */\n STAGE_INSTANCE_UPDATE: StageInstance.Event.Update\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Creates a new Stage instance associated to a Stage channel.\n * @see https://discord.com/developers/docs/resources/stage-instance#create-stage-instance\n */\n createStageInstance(params: StageInstance.Params.Create): Promise<StageInstance>\n /**\n * Gets the stage instance associated with the Stage channel, if it exists.\n * @see https://discord.com/developers/docs/resources/stage-instance#get-stage-instance\n */\n getStageInstance(channel_id: snowflake): Promise<StageInstance>\n /**\n * Updates fields of an existing Stage instance.\n * @see https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance\n */\n modifyStageInstance(channel_id: snowflake, params: StageInstance.Params.Modify): Promise<StageInstance>\n /**\n * Deletes the Stage instance.\n * @see https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance\n */\n deleteStageInstance(channel_id: snowflake): Promise<void>\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: Sticker.Type\n /** type of sticker format */\n format_type: Sticker.FormatType\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\nexport namespace Sticker {\n /** https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types */\n export enum Type {\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 */\n export enum FormatType {\n PNG = 1,\n APNG = 2,\n LOTTIE = 3,\n GIF = 4\n }\n\n /** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */\n export interface Item {\n /** id of the sticker */\n id: snowflake\n /** name of the sticker */\n name: string\n /** type of sticker format */\n format_type: FormatType\n }\n\n /** https://discord.com/developers/docs/resources/sticker#sticker-pack-object-sticker-pack-structure */\n export interface Pack {\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 export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update-guild-stickers-update-event-fields */\n export interface Update {\n /** id of the guild */\n guild_id: snowflake\n /** array of stickers */\n stickers: Sticker[]\n }\n }\n\n /** https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs-response-structure */\n export interface PackResult {\n sticker_packs: Pack[]\n }\n\n export namespace Params {\n /** https://discord.com/developers/docs/resources/sticker#create-guild-sticker-form-params */\n export interface Create {\n /** name of the sticker (2-30 characters) */\n name: string\n /** description of the sticker (empty or 2-100 characters) */\n description: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n /** the sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB */\n file: any\n }\n\n /** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker-json-params */\n export interface Modify {\n /** name of the sticker (2-30 characters) */\n name: string\n /** description of the sticker (2-100 characters) */\n description?: string\n /** autocomplete/suggestion tags for the sticker (max 200 characters) */\n tags: string\n }\n }\n}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** guild stickers were updated */\n GUILD_STICKERS_UPDATE: Sticker.Event.Update\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns a sticker object for the given sticker ID.\n * @see https://discord.com/developers/docs/resources/sticker#get-sticker\n */\n getSticker(sticker_id: snowflake): Promise<Sticker>\n /**\n * Returns the list of sticker packs available to Nitro subscribers.\n * @see https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs\n */\n listNitroStickerPacks(): Promise<Sticker.PackResult>\n /**\n * Returns an array of sticker objects for the given guild. Includes user fields if the bot has the MANAGE_EMOJIS_AND_STICKERS permission.\n * @see https://discord.com/developers/docs/resources/sticker#list-guild-stickers\n */\n listGuildStickers(guild_id: snowflake): Promise<Sticker[]>\n /**\n * Returns a sticker object for the given guild and sticker IDs. Includes the user field if the bot has the MANAGE_EMOJIS_AND_STICKERS permission.\n * @see https://discord.com/developers/docs/resources/sticker#get-guild-sticker\n */\n getGuildSticker(guild_id: snowflake, sticker_id: snowflake): Promise<Sticker>\n /**\n * Create a new sticker for the guild. Send a multipart/form-data body. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the new sticker object on success.\n * @see https://discord.com/developers/docs/resources/sticker#create-guild-sticker\n */\n createGuildSticker(guild_id: snowflake, params: Sticker.Params.Create): Promise<Sticker>\n /**\n * Modify the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns the updated sticker object on success.\n * @see https://discord.com/developers/docs/resources/sticker#modify-guild-sticker\n */\n modifyGuildSticker(guild_id: snowflake, sticker_id: snowflake, params: Sticker.Params.Modify): Promise<Sticker>\n /**\n * Delete the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission. Returns 204 No Content on success.\n * @see https://discord.com/developers/docs/resources/sticker#delete-guild-sticker\n */\n deleteGuildSticker(guild_id: snowflake, sticker_id: snowflake): Promise<void>\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 { AllowedMentions, Attachment, Channel, Component, Embed, GuildMember, integer, Internal, snowflake, timestamp } from '.'\n\ndeclare module './channel' {\n interface Channel {\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 }\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 /** additional information about the user */\n member?: GuildMember\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 /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */\n create_timestamp?: timestamp\n}\n\n/** @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads */\nexport interface ListActiveGuildThreadsResult {\n /** the active threads */\n threads: Channel[]\n /** a thread member object for each returned thread the current user has joined */\n members: ThreadMember[]\n}\n\nexport interface Thread extends Channel {}\n\nexport namespace Thread {\n /** https://discord.com/developers/docs/resources/channel#start-thread-from-message */\n export interface StartFromMessageParams {\n /** 1-100 character channel name */\n name: string\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 /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-without-message-json-params */\n export interface StartWithoutMessageParams {\n /** 1-100 character channel name */\n name: string\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 /** the type of thread to create */\n type?: integer\n /** whether non-moderators can add other non-moderators to a thread; only available when creating a private thread */\n invitable?: boolean\n /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */\n export interface StartThreadInFormChannelParams {\n /** 1-100 character channel name */\n name: string\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 /** amount of seconds a user has to wait before sending another message (0-21600) */\n rate_limit_per_user?: integer\n /** contents of the first message in the forum thread */\n message: FormThreadMessageParams\n /** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */\n applied_tags?: snowflake[]\n }\n\n /** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */\n export interface FormThreadMessageParams {\n /** Message contents (up to 2000 characters) */\n content?: string\n /** Embedded rich content (up to 6000 characters) */\n embeds?: Embed[]\n /** Allowed mentions for the message */\n allowed_mentions?: AllowedMentions\n /** Components to include with the message */\n components?: Component[]\n /** IDs of up to 3 stickers in the server to send in the message */\n sticker_ids?: snowflake[]\n /** Contents of the file being sent. */\n files: any[]\n /** JSON-encoded body of non-file params, only for multipart/form-data requests. */\n payload_json?: string\n /** Attachment objects with filename and description. */\n attachments?: Partial<Attachment>[]\n /** Message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */\n flags?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-active-threads-response-body */\n export interface List {\n /** the active threads */\n threads: Channel[]\n /** a thread member object for each returned thread the current user has joined */\n members: ThreadMember[]\n /** whether there are potentially additional threads that could be returned on a subsequent call */\n has_more: boolean\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-public-archived-threads-query-string-params */\n export interface ListPublicArchivedParams {\n /** returns threads before this timestamp */\n before?: timestamp\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-private-archived-threads-query-string-params */\n export interface ListPrivateArchivedParams {\n /** returns threads before this timestamp */\n before?: timestamp\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n /** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads-query-string-params */\n export interface ListJoinedPrivateArchivedParams {\n /** returns threads before this id */\n before?: snowflake\n /** optional maximum number of threads to return */\n limit?: integer\n }\n\n export namespace Event {\n /** https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields */\n export interface ListSync {\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\n export interface MemberUpdate extends ThreadMember {}\n\n /** https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields */\n export interface MembersUpdate {\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}\n\ndeclare module './gateway' {\n interface GatewayEvents {\n /** sent when gaining access to a channel, contains all active threads in that channel */\n THREAD_LIST_SYNC: Thread.Event.ListSync\n /** thread member for the current user was updated */\n THREAD_MEMBER_UPDATE: Thread.Event.MemberUpdate\n /** some user(s) were added to or removed from a thread */\n THREAD_MEMBERS_UPDATE: Thread.Event.MembersUpdate\n }\n}\n\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns all active threads in the guild, including public and private threads. Threads are ordered by their id, in descending order.\n * @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads\n */\n listActiveGuildThreads(guild_id: snowflake): Promise<ListActiveGuildThreadsResult>\n /**\n * Creates a new thread from an existing message. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-from-message\n */\n startThreadFromMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartFromMessageParams): Promise<Channel>\n /**\n * Creates a new thread in a forum channel, and sends a message within the created thread. Returns a channel, with a nested message object, on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create and Message Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel\n */\n startThreadInForumChannel(channel_id: snowflake, params: Thread.StartThreadInFormChannelParams): Promise<Channel>\n /**\n * Creates a new thread that is not connected to an existing message. The created thread defaults to a GUILD_PRIVATE_THREAD*. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#start-thread-without-message\n */\n startThreadWithoutMessage(channel_id: snowflake, params: Thread.StartWithoutMessageParams): Promise<Channel>\n /**\n * Adds the current user to a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#join-thread\n */\n joinThread(channel_id: snowflake): Promise<void>\n /**\n * Adds another member to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response if the member is successfully added or was already a member of the thread. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#add-thread-member\n */\n addThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Removes the current user from a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#leave-thread\n */\n leaveThread(channel_id: snowflake): Promise<void>\n /**\n * Removes another member from a thread. Requires the MANAGE_THREADS permission, or the creator of the thread if it is a GUILD_PRIVATE_THREAD. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.\n * @see https://discord.com/developers/docs/resources/channel#remove-thread-member\n */\n removeThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>\n /**\n * Returns a thread member object for the specified user if they are a member of the thread, returns a 404 response otherwise.\n * @see https://discord.com/developers/docs/resources/channel#get-thread-member\n */\n getThreadMember(channel_id: snowflake, user_id: snowflake): Promise<ThreadMember>\n /**\n * Returns array of thread members objects that are members of the thread.\n * @see https://discord.com/developers/docs/resources/channel#list-thread-members\n */\n listThreadMembers(channel_id: snowflake): Promise<ThreadMember[]>\n /**\n * Returns all active threads in the channel, including public and private threads. Threads are ordered by their id, in descending order.\n * @see https://discord.com/developers/docs/resources/channel#list-active-threads\n */\n listActiveThreads(channel_id: snowflake): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are public. When called on a GUILD_TEXT channel, returns threads of type GUILD_PUBLIC_THREAD. When called on a GUILD_NEWS channel returns threads of type GUILD_NEWS_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires the READ_MESSAGE_HISTORY permission.\n * @see https://discord.com/developers/docs/resources/channel#list-public-archived-threads\n */\n listPublicArchivedThreads(channel_id: snowflake, params?: Thread.ListPublicArchivedParams): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n * @see https://discord.com/developers/docs/resources/channel#list-private-archived-threads\n */\n listPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListPrivateArchivedParams): Promise<Thread.List>\n /**\n * Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD, and the user has joined. Threads are ordered by their id, in descending order. Requires the READ_MESSAGE_HISTORY permission.\n * @see https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads\n */\n listJoinedPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListJoinedPrivateArchivedParams): Promise<Thread.List>\n }\n}\n\nInternal.define({\n '/channels/{channel.id}/messages/{message.id}/threads': {\n POST: 'startThreadFromMessage',\n },\n '/channels/{channel.id}/threads': {\n POST: ['startThreadWithoutMessage', 'startThreadInForumChannel'],\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/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 { 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?: PremiumType\n /** the public flags on a user's account */\n public_flags?: integer\n}\n\nexport namespace User {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/user#modify-current-user-json-params */\n export interface Modify {\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 }\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 BOT_HTTP_INTERACTIONS = 1 << 19,\n ACTIVE_DEVELOPER = 1 << 22,\n}\n\n/** https://discord.com/developers/docs/resources/user#user-object-premium-types */\nexport enum PremiumType {\n NONE = 0,\n NITRO_CLASSIC = 1,\n NITRO = 2,\n NITRO_BASIC = 3,\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 /** whether this connection has a corresponding third party OAuth2 token */\n two_way_link: 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\ndeclare module './internal' {\n interface Internal {\n /**\n * Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email.\n * @see https://discord.com/developers/docs/resources/user#get-current-user\n */\n getCurrentUser(): Promise<User>\n /**\n * Returns a user object for a given user ID.\n * @see https://discord.com/developers/docs/resources/user#get-user\n */\n getUser(id: snowflake): Promise<User>\n /**\n * Modify the requester's user account settings. Returns a user object on success.\n * @see https://discord.com/developers/docs/resources/user#modify-current-user\n */\n modifyCurrentUser(params: User.Params.Modify): Promise<User>\n /**\n * Returns a list of connection objects. Requires the connections OAuth2 scope.\n * @see https://discord.com/developers/docs/resources/user#get-user-connections\n */\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/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\nexport namespace VoiceState {\n export namespace Params {\n /** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state-json-params */\n export interface ModifyCurrent extends Modify {\n /** sets the user's request to speak */\n request_to_speak_timestamp?: timestamp\n }\n\n /** https://discord.com/developers/docs/resources/guild#modify-user-voice-state-json-params */\n export interface Modify {\n /** the id of the channel the user is currently in */\n channel_id: snowflake\n /** toggles the user's suppress state */\n suppress?: boolean\n }\n }\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-events#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 /**\n * Returns an array of voice region objects that can be used when setting a voice or stage channel's rtc_region.\n * @see https://discord.com/developers/docs/resources/voice#list-voice-regions\n */\n listVoiceRegions(): Promise<VoiceRegion[]>\n /**\n * Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.\n * @see https://discord.com/developers/docs/resources/guild#get-guild-voice-regions\n */\n getGuildVoiceRegions(guild_id: snowflake): Promise<VoiceRegion[]>\n /**\n * Updates the current user's voice state.\n * @see https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state\n */\n modifyCurrentUserVoiceState(guild_id: snowflake, params: VoiceState.Params.ModifyCurrent): Promise<VoiceState>\n /**\n * Updates another user's voice state.\n * @see https://discord.com/developers/docs/resources/guild#modify-user-voice-state\n */\n modifyUserVoiceState(guild_id: snowflake, user_id: snowflake, params: VoiceState.Params.Modify): Promise<VoiceState>\n }\n}\n\nInternal.define({\n '/voice/regions': {\n GET: 'listVoiceRegions',\n },\n '/guilds/{guild.id}/regions': {\n GET: 'getGuildVoiceRegions',\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 { AllowedMentions, Attachment, Channel, Component, Embed, 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: Webhook.Type\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\nexport namespace Webhook {\n /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */\n export enum Type {\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/resources/webhook#create-webhook-json-params */\n export interface CreateParams {\n /** name of the webhook (1-80 characters) */\n name: string\n /** image for the default webhook avatar */\n avatar?: string\n }\n\n /** https://discord.com/developers/docs/resources/webhook#modify-webhook-json-params */\n export interface ModifyParams {\n /** the default name of the webhook */\n name: string\n /** image 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\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params */\n export interface ExecuteParams {\n /** waits for server confirmation of message send before response, and returns the created message body (defaults to false; when false a message that is not saved does not return an error) */\n wait: boolean\n /** Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. */\n thread_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params */\n export interface ExecuteBody {\n /** the message contents (up to 2000 characters) */\n content: string\n /** override the default username of the webhook */\n username: string\n /** override the default avatar of the webhook */\n avatar_url: string\n /** true if this is a TTS message */\n tts: boolean\n /** embedded rich content */\n embeds: Embed[]\n /** allowed mentions for the message */\n allowed_mentions: AllowedMentions\n /** the components to include with the message */\n components: Component[]\n /** the contents of the file being sent */\n files: any\n /** JSON encoded body of non-file params */\n payload_json: string\n /** attachment objects with filename and description */\n attachments: Partial<Attachment>[]\n /** message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */\n flags: integer\n /** name of thread to create (requires the webhook channel to be a forum channel) */\n thread_name: string\n }\n\n /** https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params */\n export interface MessageParams {\n /** id of the thread the message is in */\n thread_id: snowflake\n }\n\n /** https://discord.com/developers/docs/resources/webhook#edit-webhook-message-jsonform-params */\n export interface MessageBody {\n /** the message contents (up to 2000 characters) */\n content: string\n /** embedded rich content */\n embeds: Embed[]\n /** allowed mentions for the message */\n allowed_mentions: AllowedMentions\n /** the components to include with the message */\n components: Component[]\n /** the contents of the file being sent/edited */\n files: any\n /** JSON encoded body of non-file params (multipart/form-data only) */\n payload_json: string\n /** attached files to keep and possible descriptions for new files */\n attachments: Partial<Attachment>[]\n }\n}\n\n/** https://discord.com/developers/docs/topics/gateway-events#webhooks-update-webhooks-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\ndeclare module './internal' {\n interface Internal {\n /**\n * Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:\n * @see https://discord.com/developers/docs/resources/webhook#create-webhook\n */\n createWebhook(channel_id: snowflake, params: Webhook.CreateParams): Promise<Webhook>\n /**\n * Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.\n * @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks\n */\n getChannelWebhooks(channel_id: snowflake): Promise<Webhook[]>\n /**\n * Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.\n * @see https://discord.com/developers/docs/resources/webhook#get-guild-webhooks\n */\n getGuildWebhooks(guild_id: snowflake): Promise<Webhook[]>\n /**\n * Returns the new webhook object for the given id.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook\n */\n getWebhook(webhook_id: snowflake): Promise<Webhook>\n /**\n * Same as above, except this call does not require authentication and returns no user in the webhook object.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook-with-token\n */\n getWebhookWithToken(webhook_id: snowflake, token: string): Promise<Webhook>\n /**\n * Modify a webhook. Requires the MANAGE_WEBHOOKS permission. Returns the updated webhook object on success.\n * @see https://discord.com/developers/docs/resources/webhook#modify-webhook\n */\n modifyWebhook(webhook_id: snowflake, params: Webhook.ModifyParams): Promise<Webhook>\n /**\n * Same as above, except this call does not require authentication, does not accept a channel_id parameter in the body, and does not return a user in the webhook object.\n * @see https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token\n */\n modifyWebhookWithToken(webhook_id: snowflake, token: string, params: Webhook.ModifyParams): Promise<Webhook>\n /**\n * Delete a webhook permanently. Requires the MANAGE_WEBHOOKS permission. Returns a 204 No Content response on success.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook\n */\n deleteWebhook(webhook_id: snowflake): Promise<void>\n /**\n * Same as above, except this call does not require authentication.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token\n */\n deleteWebhookwithToken(webhook_id: snowflake, token: string): Promise<void>\n /**\n * Refer to Uploading Files for details on attachments and multipart/form-data requests.\n * @see https://discord.com/developers/docs/resources/webhook#execute-webhook\n */\n executeWebhook(webhook_id: snowflake, token: string, body: Webhook.ExecuteBody, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Refer to Slack's documentation for more information. We do not support Slack's channel, icon_emoji, mrkdwn, or mrkdwn_in properties.\n * @see https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook\n */\n executeSlackCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Add a new webhook to your GitHub repo (in the repo's settings), and use this endpoint as the \"Payload URL.\" You can choose what events your Discord channel receives by choosing the \"Let me select individual events\" option and selecting individual events for the new webhook you're configuring.\n * @see https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook\n */\n executeGitHubCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>\n /**\n * Returns a previously-sent webhook message from the same token. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/webhook#get-webhook-message\n */\n getWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): Promise<Message>\n /**\n * Edits a previously-sent webhook message from the same token. Returns a message object on success.\n * @see https://discord.com/developers/docs/resources/webhook#edit-webhook-message\n */\n editWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, body: Webhook.MessageBody, query: Webhook.MessageParams): Promise<void>\n /**\n * Deletes a message that was created by the webhook. Returns a 204 No Content response on success.\n * @see https://discord.com/developers/docs/resources/webhook#delete-webhook-message\n */\n deleteWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): 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", "// Last updated: Jan 24, 2023\n\nexport * from './internal'\n\nexport * from './application'\nexport * from './application-role-connection'\nexport * from './audit-log'\nexport * from './auto-moderation'\nexport * from './ban'\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 './reaction'\nexport * from './role'\nexport * from './scheduled-event'\nexport * from './stage-instance'\nexport * from './sticker'\nexport * from './team'\nexport * from './thread'\nexport * from './user'\nexport * from './voice'\nexport * from './webhook'\n\nexport type integer = number\nexport type snowflake = string\nexport type timestamp = string\n\n/** @see https://discord.com/developers/docs/reference#locales */\nexport type Locale = typeof Locale[number]\n\nexport const Locale = [\n 'da', 'de', 'en-GB', 'en-US', 'es-ES',\n 'fr', 'hr', 'it', 'lt', 'hu',\n 'nl', 'no', 'pl', 'pt-BR', 'ro',\n 'fi', 'sv-SE', 'vi', 'tr', 'cs',\n 'el', 'bg', 'ru', 'uk', 'hi',\n 'th', 'zh-CN', 'ja', 'zh-TW', 'ko',\n] as const\n", "import { Dict, h, Logger, MessageEncoder, Quester, Schema, Universal } from '@satorijs/satori'\nimport FormData from 'form-data'\nimport { DiscordBot } from './bot'\nimport { Channel, Message } from './types'\nimport { decodeMessage, sanitize } from './utils'\n\ntype RenderMode = 'default' | 'figure'\n\nconst logger = new Logger('discord')\n\nclass State {\n author: Partial<Universal.User> = {}\n quote: Partial<Universal.Message> = {}\n channel: Partial<Channel> = {}\n fakeMessageMap: Record<string, Universal.Message[]> = {} // [userInput] = discord messages\n threadCreated = false // forward: send the first message and create a thread\n\n constructor(public type: 'message' | 'forward') { }\n}\n\nexport class DiscordMessageEncoder extends MessageEncoder<DiscordBot> {\n private stack: State[] = [new State('message')]\n private buffer: string = ''\n private addition: Dict = {}\n private figure: h = null\n private mode: RenderMode = 'default'\n private listType: 'ol' | 'ul' = null\n\n private async getUrl() {\n const input = this.options?.session?.discord\n if (input?.t === 'INTERACTION_CREATE') {\n // 消息交互\n return `/webhooks/${input.d.application_id}/${input.d.token}`\n } else if (this.stack[0].type === 'forward' && this.stack[0].channel?.id) {\n // 发送到子区\n if (this.stack[1].author.name || this.stack[1].author.avatar) {\n const webhook = await this.ensureWebhook()\n return `/webhooks/${webhook.id}/${webhook.token}?wait=true&thread_id=${this.stack[0].channel?.id}`\n } else {\n return `/channels/${this.stack[0].channel.id}/messages`\n }\n } else {\n if (this.stack[0].author.name || this.stack[0].author.avatar || (this.stack[0].type === 'forward' && !this.stack[0].threadCreated)) {\n const webhook = await this.ensureWebhook()\n return `/webhooks/${webhook.id}/${webhook.token}?wait=true`\n } else {\n return `/channels/${this.channelId}/messages`\n }\n }\n }\n\n async post(data?: any, headers?: any) {\n try {\n const url = await this.getUrl()\n const result = await this.bot.http.post<Message>(url, data, { headers })\n const session = this.bot.session()\n const message = await decodeMessage(this.bot, result, session.event.message = {}, session.event)\n session.app.emit(session, 'send', session)\n this.results.push(session.event.message)\n Object.defineProperty(session.event.message, 'channel', {\n configurable: true,\n get: () => session.event.channel,\n })\n\n if (this.stack[0].type === 'forward' && !this.stack[0].threadCreated) {\n this.stack[0].threadCreated = true\n const thread = await this.bot.internal.startThreadFromMessage(this.channelId, result.id, {\n name: 'Forward',\n auto_archive_duration: 60,\n })\n this.stack[0].channel = thread\n }\n\n return message\n } catch (e) {\n if (Quester.isAxiosError(e) && e.response) {\n if (e.response.data?.code === 10015) {\n logger.debug('webhook has been deleted, recreating..., %o', e.response.data)\n if (!this.bot.webhookLock[this.channelId]) this.bot.webhooks[this.channelId] = null\n await this.ensureWebhook()\n return this.post(data, headers)\n } else {\n e = new Error(`[${e.response.status}] ${JSON.stringify(e.response.data)}`)\n }\n }\n this.errors.push(e)\n }\n }\n\n async sendEmbed(attrs: Dict, payload: Dict) {\n const { filename, data, mime } = await this.bot.ctx.http.file(attrs.url, attrs)\n const form = new FormData()\n // https://github.com/form-data/form-data/issues/468\n const value = process.env.KOISHI_ENV === 'browser'\n ? new Blob([data], { type: mime })\n : Buffer.from(data)\n form.append('file', value, attrs.file || filename)\n form.append('payload_json', JSON.stringify(payload))\n return this.post(form, form.getHeaders())\n }\n\n async sendAsset(type: string, attrs: Dict<string>, addition: Dict) {\n const { handleMixedContent, handleExternalAsset } = this.bot.config as DiscordMessageEncoder.Config\n\n if (handleMixedContent === 'separate' && addition.content) {\n await this.post(addition)\n addition.content = ''\n }\n\n const sendDirect = async () => {\n if (addition.content) {\n await this.post(addition)\n }\n return this.post({ ...addition, content: attrs.url })\n }\n\n if (this.bot.http.isPrivate(attrs.url)) {\n return await this.sendEmbed(attrs, addition)\n }\n\n const mode = attrs.mode as DiscordMessageEncoder.HandleExternalAsset || handleExternalAsset\n if (mode === 'download' || handleMixedContent === 'attach' && addition.content || type === 'file') {\n return this.sendEmbed(attrs, addition)\n } else if (mode === 'direct') {\n return sendDirect()\n }\n\n // auto mode\n if (await this.checkMediaType(attrs.url, type)) {\n return sendDirect()\n } else {\n return this.sendEmbed(attrs, addition)\n }\n }\n\n checkMediaType(url: string, type: string) {\n if (url.startsWith('https://cdn.discordapp.com/')) return true\n return this.bot.ctx.http.head(url, {\n headers: { accept: type + '/*' },\n timeout: 1000,\n }).then(\n (headers) => headers['content-type'].startsWith(type),\n () => false,\n )\n }\n\n async ensureWebhook() {\n return this.bot.ensureWebhook(this.channelId)\n }\n\n async flush() {\n const content = this.buffer.trim()\n if (!content) return\n await this.post({ ...this.addition, content })\n this.buffer = ''\n this.addition = {}\n }\n\n async visit(element: h) {\n const { type, attrs, children } = element\n if (type === 'text') {\n this.buffer += sanitize(attrs.content)\n } else if (type === 'b' || type === 'strong') {\n this.buffer += '**'\n await this.render(children)\n this.buffer += '**'\n } else if (type === 'i' || type === 'em') {\n this.buffer += '*'\n await this.render(children)\n this.buffer += '*'\n } else if (type === 'u' || type === 'ins') {\n this.buffer += '__'\n await this.render(children)\n this.buffer += '__'\n } else if (type === 's' || type === 'del') {\n this.buffer += '~~'\n await this.render(children)\n this.buffer += '~~'\n } else if (type === 'spl') {\n this.buffer += '||'\n await this.render(children)\n this.buffer += '||'\n } else if (type === 'code') {\n this.buffer += '`'\n await this.render(children)\n this.buffer += '`'\n } else if (type === 'a') {\n await this.render(children)\n if (this.options.linkPreview) {\n this.buffer += ` (${attrs.href}) `\n } else {\n this.buffer += ` (<${attrs.href}>) `\n }\n } else if (type === 'br') {\n this.buffer += '\\n'\n } else if (type === 'p') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n await this.render(children)\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n this.buffer += '\\n'\n } else if (type === 'blockquote') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n this.buffer += '> '\n await this.render(children)\n this.buffer += '\\n'\n } else if (type === 'ul' || type === 'ol') {\n this.listType = type\n await this.render(children)\n this.listType = null\n } else if (type === 'li') {\n if (!this.buffer.endsWith('\\n')) this.buffer += '\\n'\n if (this.listType === 'ol') {\n this.buffer += '0. '\n } else if (this.listType === 'ul') {\n this.buffer += '- '\n }\n this.render(children)\n this.buffer += '\\n'\n } else if (type === 'at') {\n if (attrs.id) {\n this.buffer += `<@${attrs.id}>`\n } else if (attrs.type === 'all') {\n this.buffer += `@everyone`\n } else if (attrs.type === 'here') {\n this.buffer += `@here`\n }\n } else if (type === 'sharp' && attrs.id) {\n this.buffer += `<#${attrs.id}>`\n } else if (type === 'face') {\n if (attrs.platform && attrs.platform !== this.bot.platform) {\n return this.render(children)\n } else {\n this.buffer += `<${attrs.animated ? 'a' : ''}:${attrs.name}:${attrs.id}>`\n }\n } else if ((type === 'image' || type === 'video') && attrs.url) {\n if (this.mode === 'figure') {\n this.figure = element\n } else {\n await this.sendAsset(type, attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n }\n } else if (type === 'share') {\n await this.flush()\n await this.post({\n ...this.addition,\n embeds: [{ ...attrs }],\n })\n } else if (type === 'audio') {\n await this.sendAsset('file', attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n } else if (type === 'author') {\n const { avatar, nickname } = attrs\n if (avatar) this.addition.avatar_url = avatar\n if (nickname) this.addition.username = nickname\n if (this.stack[0].type === 'message') {\n this.stack[0].author = attrs\n }\n if (this.stack[0].type === 'forward') {\n this.stack[1].author = attrs\n }\n } else if (type === 'quote') {\n await this.flush()\n const parse = (val: string) => val.replace(/\\\\([\\\\*_`~|()\\[\\]])/g, '$1')\n\n const message = this.stack[this.stack[0].type === 'forward' ? 1 : 0]\n if (!message.author.avatar && !message.author.name && this.stack[0].type !== 'forward') {\n // no quote and author, send by bot\n await this.flush()\n this.addition.message_reference = {\n message_id: attrs.id,\n }\n } else {\n // quote\n let replyId = attrs.id, channelId = this.channelId\n if (this.stack[0].type === 'forward' && this.stack[0].fakeMessageMap[attrs.id]?.length >= 1) {\n // quote to fake message, eg. 1st message has id (in channel or thread), later message quote to it\n replyId = this.stack[0].fakeMessageMap[attrs.id][0].id\n channelId = this.stack[0].fakeMessageMap[attrs.id][0].channel.id\n }\n const quote = await this.bot.getMessage(channelId, replyId)\n this.addition.embeds = [{\n description: [\n sanitize(parse(quote.elements.filter(v => v.type === 'text').join('')).slice(0, 30)),\n `<t:${Math.ceil(quote.timestamp / 1000)}:R> [[ ↑ ]](https://discord.com/channels/${this.guildId}/${channelId}/${replyId})`,\n ].join('\\n\\n'),\n author: {\n name: quote.user.name,\n icon_url: quote.user.avatar,\n },\n }]\n }\n } else if (type === 'figure') {\n await this.flush()\n this.mode = 'figure'\n await this.render(children)\n await this.sendAsset(this.figure.type, this.figure.attrs, {\n ...this.addition,\n content: this.buffer.trim(),\n })\n this.buffer = ''\n this.mode = 'default'\n } else if (type === 'message' && !attrs.forward) {\n if (this.mode === 'figure') {\n await this.render(children)\n this.buffer += '\\n'\n } else {\n const resultLength = +this.results.length\n await this.flush()\n\n await this.render(children)\n await this.flush()\n const newLength = +this.results.length\n const sentMessages = this.results.slice(resultLength, newLength)\n if (this.stack[0].type === 'forward' && attrs.id) {\n this.stack[0].fakeMessageMap[attrs.id] = sentMessages\n }\n if (this.stack[0].type === 'message') {\n this.stack[0].author = {}\n }\n if (this.stack[0].type === 'forward') {\n this.stack[1].author = {}\n }\n }\n } else if (type === 'message' && attrs.forward) {\n this.stack.unshift(new State('forward'))\n await this.render(children)\n await this.flush()\n await this.bot.internal.modifyChannel(this.stack[0].channel.id, {\n archived: true,\n locked: true,\n })\n this.stack.shift()\n } else {\n await this.render(children)\n }\n }\n}\n\nexport namespace DiscordMessageEncoder {\n export type HandleExternalAsset = 'auto' | 'download' | 'direct'\n export type HandleMixedContent = 'auto' | 'separate' | 'attach'\n\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 export const Config: Schema<DiscordMessageEncoder.Config> = Schema.object({\n handleExternalAsset: Schema.union([\n Schema.const('download').description('先下载后发送'),\n Schema.const('direct').description('直接发送链接'),\n Schema.const('auto').description('发送一个 HEAD 请求,根据返回的 Content-Type 决定发送方式'),\n ]).role('radio').description('发送外链资源时采用的方式。').default('auto'),\n handleMixedContent: Schema.union([\n Schema.const('separate').description('将每个不同形式的内容分开发送'),\n Schema.const('attach').description('图片前如果有文本内容,则将文本作为图片的附带信息进行发送'),\n Schema.const('auto').description('如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送'),\n ]).role('radio').description('发送图文等混合内容时采用的方式。').default('auto'),\n }).description('发送设置')\n}\n", "import { Adapter, Logger, Schema } from '@satorijs/satori'\nimport { Gateway } from './types'\nimport { adaptSession, decodeUser } from './utils'\nimport { DiscordBot } from './bot'\n\nconst logger = new Logger('discord')\n\nexport class WsClient extends Adapter.WsClient<DiscordBot> {\n _d = 0\n _ping: NodeJS.Timeout\n _sessionId = ''\n _resumeUrl: string\n\n async prepare() {\n if (this._resumeUrl) {\n return this.bot.http.ws(this._resumeUrl + '/?v=10&encoding=json')\n }\n const { url } = await this.bot.internal.getGatewayBot()\n return this.bot.http.ws(url + '/?v=10&encoding=json')\n }\n\n heartbeat() {\n logger.debug(`heartbeat d ${this._d}`)\n this.socket.send(JSON.stringify({\n op: Gateway.Opcode.HEARTBEAT,\n d: this._d,\n }))\n }\n\n accept() {\n this.socket.addEventListener('message', async ({ data }) => {\n let parsed: Gateway.Payload\n try {\n parsed = JSON.parse(data.toString())\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 this._d = parsed.s\n }\n\n // https://discord.com/developers/docs/topics/gateway#connection-lifecycle\n if (parsed.op === Gateway.Opcode.HELLO) {\n this._ping = setInterval(() => this.heartbeat(), parsed.d.heartbeat_interval)\n if (this._sessionId) {\n logger.debug('resuming')\n this.socket.send(JSON.stringify({\n op: Gateway.Opcode.RESUME,\n d: {\n token: this.bot.config.token,\n session_id: this._sessionId,\n seq: this._d,\n },\n }))\n } else {\n this.socket.send(JSON.stringify({\n op: Gateway.Opcode.IDENTIFY,\n d: {\n token: this.bot.config.token,\n properties: {},\n compress: false,\n intents: this.bot.config.intents,\n },\n }))\n }\n }\n\n if (parsed.op === Gateway.Opcode.INVALID_SESSION) {\n if (parsed.d) return\n this._sessionId = ''\n logger.warn('offline: invalid session')\n this.socket?.close()\n }\n\n if (parsed.op === Gateway.Opcode.DISPATCH) {\n this.bot.dispatch(this.bot.session({\n type: 'internal',\n _type: 'discord/' + parsed.t.toLowerCase().replace(/_/g, '-'),\n _data: parsed,\n }))\n if (parsed.t === 'READY') {\n this._sessionId = parsed.d.session_id\n this._resumeUrl = parsed.d.resume_gateway_url\n this.bot.user = decodeUser(parsed.d.user)\n logger.debug('session_id ' + this._sessionId)\n return this.bot.online()\n }\n if (parsed.t === 'RESUMED') {\n return this.bot.online()\n }\n const session = await adaptSession(this.bot, parsed)\n if (session) this.bot.dispatch(session)\n }\n\n if (parsed.op === Gateway.Opcode.RECONNECT) {\n logger.warn('offline: discord request reconnect')\n this.socket?.close()\n }\n })\n\n this.socket.addEventListener('close', () => {\n clearInterval(this._ping)\n })\n }\n}\n\nexport namespace WsClient {\n export interface Config extends Adapter.WsClientConfig {\n intents?: number\n }\n\n export const Config: Schema<Config> = Schema.intersect([\n Schema.object({\n intents: Schema.bitset(Gateway.Intent).description('需要订阅的机器人事件。').default(0\n | Gateway.Intent.GUILD_MESSAGES\n | Gateway.Intent.GUILD_MESSAGE_REACTIONS\n | Gateway.Intent.DIRECT_MESSAGES\n | Gateway.Intent.DIRECT_MESSAGE_REACTIONS\n | Gateway.Intent.MESSAGE_CONTENT),\n }).description('推送设置'),\n Adapter.WsClientConfig,\n ] as const)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAA0F;;;ACA1F;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,4BAAAC;AAAA,EAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA;AAAA,6BAAAC;AA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AAAA,IACrD,sBAAO,OAAO;AAAA,MACZ,OAAO,sBAAO,OAAO,EAAE,YAAY,WAAW,EAAE,KAAK,QAAQ,EAAE,SAAS;AAAA,IAC1E,CAAC;AAAA,IACD,sBAAO,OAAO;AAAA,MACZ,OAAO,sBAAO,QAAQ,EAAE,YAAY,WAAW,EAAE,QAAQ,IAAI;AAAA,IAC/D,CAAC,EAAE,YAAY,MAAM;AAAA,IACrB,SAAS;AAAA,IACT,sBAAsB;AAAA,IACtB,uBAAQ,aAAa,6BAA6B;AAAA,EACpD,CAAC;AAAA,GAhBc;;;AD3OjB,IAAO,cAAQ;",
6
+ "names": ["import_satori", "ApplicationCommand", "AutoModerationRule", "Channel", "Guild", "GuildScheduledEvent", "Locale", "Message", "StatusType", "Sticker", "Webhook", "import_satori", "ApplicationFlag", "ApplicationRoleConnection", "MetadataType", "AuditLog", "Type", "AutoModerationRule", "EventType", "TriggerType", "KeywordPresetType", "AutoModerationAction", "Type", "Channel", "Type", "OverwriteType", "AllowedMentionType", "ApplicationCommand", "Type", "OptionType", "PermissionType", "ComponentType", "ButtonStyles", "TextInputStyles", "DeviceType", "Gateway", "Opcode", "Intent", "Guild", "Params", "WidgetStyleOptions", "SystemChannelFlag", "GuildFeature", "IntegrationExpireBehavior", "Interaction", "Type", "CallbackType", "Invite", "TargetType", "Message", "Type", "ActivityType", "Flag", "StatusType", "ActivityType", "ActivityFlag", "Permission", "GuildScheduledEvent", "PrivacyLevel", "EntityType", "Status", "Sticker", "Type", "FormatType", "MembershipState", "UserFlag", "PremiumType", "VisibilityType", "Webhook", "Type", "Locale", "Channel", "_a", "ApplicationCommand", "Locale", "import_satori", "FormData", "DiscordMessageEncoder", "import_satori", "logger", "WsClient", "logger", "data", "ApplicationCommand", "DiscordBot"]
7
7
  }