mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Expose DiscordAPIError and API error constants (#1641)
* Expose DiscordAPIError * Expose API error constants * Add typedef for APIError * Integligently forgot to save file
This commit is contained in:
@@ -11,6 +11,7 @@ module.exports = {
|
||||
// Utilities
|
||||
Collection: require('./util/Collection'),
|
||||
Constants: require('./util/Constants'),
|
||||
DiscordAPIError: require('./client/rest/DiscordAPIError'),
|
||||
EvaluatedPermissions: require('./util/Permissions'),
|
||||
Permissions: require('./util/Permissions'),
|
||||
Snowflake: require('./util/Snowflake'),
|
||||
|
||||
@@ -594,3 +594,96 @@ exports.Colors = {
|
||||
DARK_BUT_NOT_BLACK: 0x2C2F33,
|
||||
NOT_QUITE_BLACK: 0x23272A,
|
||||
};
|
||||
|
||||
/**
|
||||
* An error encountered while performing an API request. Here are the potential errors:
|
||||
* - UNKNOWN_ACCOUNT
|
||||
* - UNKNOWN_APPLICATION
|
||||
* - UNKNOWN_CHANNEL
|
||||
* - UNKNOWN_GUILD
|
||||
* - UNKNOWN_INTEGRATION
|
||||
* - UNKNOWN_INVITE
|
||||
* - UNKNOWN_MEMBER
|
||||
* - UNKNOWN_MESSAGE
|
||||
* - UNKNOWN_OVERWRITE
|
||||
* - UNKNOWN_PROVIDER
|
||||
* - UNKNOWN_ROLE
|
||||
* - UNKNOWN_TOKEN
|
||||
* - UNKNOWN_USER
|
||||
* - UNKNOWN_EMOJI
|
||||
* - BOT_PROHIBITED_ENDPOINT
|
||||
* - BOT_ONLY_ENDPOINT
|
||||
* - MAXIMUM_GUILDS
|
||||
* - MAXIMUM_FRIENDS
|
||||
* - MAXIMUM_PINS
|
||||
* - MAXIMUM_ROLES
|
||||
* - MAXIMUM_REACTIONS
|
||||
* - UNAUTHORIZED
|
||||
* - MISSING_ACCESS
|
||||
* - INVALID_ACCOUNT_TYPE
|
||||
* - CANNOT_EXECUTE_ON_DM
|
||||
* - EMBED_DISABLED
|
||||
* - CANNOT_EDIT_MESSAGE_BY_OTHER
|
||||
* - CANNOT_SEND_EMPTY_MESSAGE
|
||||
* - CANNOT_MESSAGE_USER
|
||||
* - CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL
|
||||
* - CHANNEL_VERIFICATION_LEVEL_TOO_HIGH
|
||||
* - OAUTH2_APPLICATION_BOT_ABSENT
|
||||
* - MAXIMUM_OAUTH2_APPLICATIONS
|
||||
* - INVALID_OAUTH_STATE
|
||||
* - MISSING_PERMISSIONS
|
||||
* - INVALID_AUTHENTICATION_TOKEN
|
||||
* - NOTE_TOO_LONG
|
||||
* - INVALID_BULK_DELETE_QUANTITY
|
||||
* - CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL
|
||||
* - CANNOT_EXECUTE_ON_SYSTEM_MESSAGE
|
||||
* - BULK_DELETE_MESSAGE_TOO_OLD
|
||||
* - INVITE_ACCEPTED_TO_GUILD_NOT_CONTANING_BOT
|
||||
* - REACTION_BLOCKED
|
||||
* @typedef {string} APIError
|
||||
*/
|
||||
exports.APIErrors = {
|
||||
UNKNOWN_ACCOUNT: 10001,
|
||||
UNKNOWN_APPLICATION: 10002,
|
||||
UNKNOWN_CHANNEL: 10003,
|
||||
UNKNOWN_GUILD: 10004,
|
||||
UNKNOWN_INTEGRATION: 10005,
|
||||
UNKNOWN_INVITE: 10006,
|
||||
UNKNOWN_MEMBER: 10007,
|
||||
UNKNOWN_MESSAGE: 10008,
|
||||
UNKNOWN_OVERWRITE: 10009,
|
||||
UNKNOWN_PROVIDER: 10010,
|
||||
UNKNOWN_ROLE: 10011,
|
||||
UNKNOWN_TOKEN: 10012,
|
||||
UNKNOWN_USER: 10013,
|
||||
UNKNOWN_EMOJI: 10014,
|
||||
BOT_PROHIBITED_ENDPOINT: 20001,
|
||||
BOT_ONLY_ENDPOINT: 20002,
|
||||
MAXIMUM_GUILDS: 30001,
|
||||
MAXIMUM_FRIENDS: 30002,
|
||||
MAXIMUM_PINS: 30003,
|
||||
MAXIMUM_ROLES: 30005,
|
||||
MAXIMUM_REACTIONS: 30010,
|
||||
UNAUTHORIZED: 40001,
|
||||
MISSING_ACCESS: 50001,
|
||||
INVALID_ACCOUNT_TYPE: 50002,
|
||||
CANNOT_EXECUTE_ON_DM: 50003,
|
||||
EMBED_DISABLED: 50004,
|
||||
CANNOT_EDIT_MESSAGE_BY_OTHER: 50005,
|
||||
CANNOT_SEND_EMPTY_MESSAGE: 50006,
|
||||
CANNOT_MESSAGE_USER: 50007,
|
||||
CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008,
|
||||
CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009,
|
||||
OAUTH2_APPLICATION_BOT_ABSENT: 50010,
|
||||
MAXIMUM_OAUTH2_APPLICATIONS: 50011,
|
||||
INVALID_OAUTH_STATE: 50012,
|
||||
MISSING_PERMISSIONS: 50013,
|
||||
INVALID_AUTHENTICATION_TOKEN: 50014,
|
||||
NOTE_TOO_LONG: 50015,
|
||||
INVALID_BULK_DELETE_QUANTITY: 50016,
|
||||
CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019,
|
||||
CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021,
|
||||
BULK_DELETE_MESSAGE_TOO_OLD: 50034,
|
||||
INVITE_ACCEPTED_TO_GUILD_NOT_CONTANING_BOT: 50036,
|
||||
REACTION_BLOCKED: 90001,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user