UNPKG

discord-api-types

Version:

Discord API typings that are kept up to date for use in bot library creation.

277 lines • 15.4 kB
"use strict"; /** * Types extracted from https://discord.com/developers/docs/topics/gateway */ Object.defineProperty(exports, "__esModule", { value: true }); exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; exports.GatewayVersion = '10'; /** * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes} */ var GatewayOpcodes; (function (GatewayOpcodes) { /** * An event was dispatched */ GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch"; /** * A bidirectional opcode to maintain an active gateway connection. * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client. */ GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat"; /** * Starts a new session during the initial handshake */ GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify"; /** * Update the client's presence */ GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate"; /** * Used to join/leave or move between voice channels */ GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate"; /** * Resume a previous session that was disconnected */ GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume"; /** * You should attempt to reconnect and resume immediately */ GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect"; /** * Request information about offline guild members in a large guild */ GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers"; /** * The session has been invalidated. You should reconnect and identify/resume accordingly */ GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession"; /** * Sent immediately after connecting, contains the `heartbeat_interval` to use */ GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello"; /** * Sent in response to receiving a heartbeat to acknowledge that it has been received */ GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck"; /** * Request information about soundboard sounds in a set of guilds */ GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds"; })(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {})); /** * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes} */ var GatewayCloseCodes; (function (GatewayCloseCodes) { /** * We're not sure what went wrong. Try reconnecting? */ GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError"; /** * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure} */ GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; /** * You sent an invalid payload to us. Don't do that! * * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events} */ GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; /** * You sent us a payload prior to identifying * * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; /** * The account token sent with your identify payload is incorrect * * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify} */ GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; /** * You sent more than one identify payload. Don't do that! */ GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated"; /** * The sequence sent when resuming the session was invalid. Reconnect and start a new session * * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume} */ GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; /** * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this */ GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited"; /** * Your session timed out. Reconnect and start a new one */ GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut"; /** * You sent us an invalid shard when identifying * * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; /** * The session would have handled too many guilds - you are required to shard your connection in order to connect * * @see {@link https://discord.com/developers/docs/topics/gateway#sharding} */ GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; /** * You sent an invalid version for the gateway */ GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion"; /** * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} */ GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; /** * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not * enabled or are not whitelisted for * * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents} * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents} */ GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; })(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {})); /** * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents} */ var GatewayIntentBits; (function (GatewayIntentBits) { GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds"; GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration"; /** * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration} */ GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions"; /** * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions} */ GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks"; GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites"; GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates"; GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences"; GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages"; GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions"; GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping"; GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages"; GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions"; GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping"; GatewayIntentBits[GatewayIntentBits["MessageContent"] = 32768] = "MessageContent"; GatewayIntentBits[GatewayIntentBits["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents"; GatewayIntentBits[GatewayIntentBits["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration"; GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution"; GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls"; GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls"; })(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {})); /** * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events} */ var GatewayDispatchEvents; (function (GatewayDispatchEvents) { GatewayDispatchEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE"; GatewayDispatchEvents["AutoModerationActionExecution"] = "AUTO_MODERATION_ACTION_EXECUTION"; GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE"; GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE"; GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE"; GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; GatewayDispatchEvents["EntitlementCreate"] = "ENTITLEMENT_CREATE"; GatewayDispatchEvents["EntitlementDelete"] = "ENTITLEMENT_DELETE"; GatewayDispatchEvents["EntitlementUpdate"] = "ENTITLEMENT_UPDATE"; GatewayDispatchEvents["GuildAuditLogEntryCreate"] = "GUILD_AUDIT_LOG_ENTRY_CREATE"; GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE"; GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE"; GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE"; GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD"; GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE"; GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK"; GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE"; GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; GatewayDispatchEvents["GuildScheduledEventCreate"] = "GUILD_SCHEDULED_EVENT_CREATE"; GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE"; GatewayDispatchEvents["GuildScheduledEventUpdate"] = "GUILD_SCHEDULED_EVENT_UPDATE"; GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD"; GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE"; GatewayDispatchEvents["GuildSoundboardSoundCreate"] = "GUILD_SOUNDBOARD_SOUND_CREATE"; GatewayDispatchEvents["GuildSoundboardSoundDelete"] = "GUILD_SOUNDBOARD_SOUND_DELETE"; GatewayDispatchEvents["GuildSoundboardSoundsUpdate"] = "GUILD_SOUNDBOARD_SOUNDS_UPDATE"; GatewayDispatchEvents["GuildSoundboardSoundUpdate"] = "GUILD_SOUNDBOARD_SOUND_UPDATE"; GatewayDispatchEvents["SoundboardSounds"] = "SOUNDBOARD_SOUNDS"; GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE"; GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE"; GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE"; GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE"; GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE"; GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE"; GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE"; GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; GatewayDispatchEvents["MessagePollVoteAdd"] = "MESSAGE_POLL_VOTE_ADD"; GatewayDispatchEvents["MessagePollVoteRemove"] = "MESSAGE_POLL_VOTE_REMOVE"; GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; GatewayDispatchEvents["RateLimited"] = "RATE_LIMITED"; GatewayDispatchEvents["Ready"] = "READY"; GatewayDispatchEvents["Resumed"] = "RESUMED"; GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE"; GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE"; GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE"; GatewayDispatchEvents["SubscriptionCreate"] = "SUBSCRIPTION_CREATE"; GatewayDispatchEvents["SubscriptionDelete"] = "SUBSCRIPTION_DELETE"; GatewayDispatchEvents["SubscriptionUpdate"] = "SUBSCRIPTION_UPDATE"; GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE"; GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE"; GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC"; GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE"; GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE"; GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE"; GatewayDispatchEvents["TypingStart"] = "TYPING_START"; GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; GatewayDispatchEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND"; GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; })(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {})); /** * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types} */ var VoiceChannelEffectSendAnimationType; (function (VoiceChannelEffectSendAnimationType) { /** * A fun animation, sent by a Nitro subscriber */ VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Premium"] = 0] = "Premium"; /** * The standard animation */ VoiceChannelEffectSendAnimationType[VoiceChannelEffectSendAnimationType["Basic"] = 1] = "Basic"; })(VoiceChannelEffectSendAnimationType || (exports.VoiceChannelEffectSendAnimationType = VoiceChannelEffectSendAnimationType = {})); // #endregion Shared //# sourceMappingURL=v10.js.map