RESTErrorCode
constRESTErrorCode:object
Defined in: packages/rest/src/error-codes.ts:10
Discord JSON error codes that bots commonly handle, by name, for comparing
with RESTError.code: if (error.code === RESTErrorCode.UnknownMessage) âŚ.
Values are from Discordâs âJSON Error Codesâ table
(discord/discord-api-docs, developers/topics/opcodes-and-status-codes.mdx,
checked at commit 86f0a46). Any other code is still available as a number
on RESTError.code.
Type Declaration
Section titled âType DeclarationâBotsCannotUseEndpoint
Section titled âBotsCannotUseEndpointâ
readonlyBotsCannotUseEndpoint:20001=20001
CannotEditOthersMessage
Section titled âCannotEditOthersMessageâ
readonlyCannotEditOthersMessage:50005=50005
CannotExecuteInDM
Section titled âCannotExecuteInDMâ
readonlyCannotExecuteInDM:50003=50003
CannotReplyWithoutReadHistory
Section titled âCannotReplyWithoutReadHistoryâ
readonlyCannotReplyWithoutReadHistory:160002=160002
CannotSendEmptyMessage
Section titled âCannotSendEmptyMessageâ
readonlyCannotSendEmptyMessage:50006=50006
CannotSendMessagesToUser
Section titled âCannotSendMessagesToUserâ
readonlyCannotSendMessagesToUser:50007=50007
InteractionAlreadyAcknowledged
Section titled âInteractionAlreadyAcknowledgedâ
readonlyInteractionAlreadyAcknowledged:40060=40060
InvalidFormBody
Section titled âInvalidFormBodyâ
readonlyInvalidFormBody:50035=50035
InvalidToken
Section titled âInvalidTokenâ
readonlyInvalidToken:50014=50014
MaxChannels
Section titled âMaxChannelsâ
readonlyMaxChannels:30013=30013
MaxEmojis
Section titled âMaxEmojisâ
readonlyMaxEmojis:30008=30008
MaxGuilds
Section titled âMaxGuildsâ
readonlyMaxGuilds:30001=30001
MaxPins
Section titled âMaxPinsâ
readonlyMaxPins:30003=30003
MaxReactions
Section titled âMaxReactionsâ
readonlyMaxReactions:30010=30010
MaxRoles
Section titled âMaxRolesâ
readonlyMaxRoles:30005=30005
MaxWebhooks
Section titled âMaxWebhooksâ
readonlyMaxWebhooks:30007=30007
MessageTooOldToBulkDelete
Section titled âMessageTooOldToBulkDeleteâ
readonlyMessageTooOldToBulkDelete:50034=50034
MissingAccess
Section titled âMissingAccessâ
readonlyMissingAccess:50001=50001
MissingPermissions
Section titled âMissingPermissionsâ
readonlyMissingPermissions:50013=50013
ThreadArchived
Section titled âThreadArchivedâ
readonlyThreadArchived:50083=50083
UnknownAccount
Section titled âUnknownAccountâ
readonlyUnknownAccount:10001=10001
UnknownBan
Section titled âUnknownBanâ
readonlyUnknownBan:10026=10026
UnknownChannel
Section titled âUnknownChannelâ
readonlyUnknownChannel:10003=10003
UnknownEmoji
Section titled âUnknownEmojiâ
readonlyUnknownEmoji:10014=10014
UnknownGuild
Section titled âUnknownGuildâ
readonlyUnknownGuild:10004=10004
UnknownInteraction
Section titled âUnknownInteractionâ
readonlyUnknownInteraction:10062=10062
UnknownInvite
Section titled âUnknownInviteâ
readonlyUnknownInvite:10006=10006
UnknownMember
Section titled âUnknownMemberâ
readonlyUnknownMember:10007=10007
UnknownMessage
Section titled âUnknownMessageâ
readonlyUnknownMessage:10008=10008
UnknownPermissionOverwrite
Section titled âUnknownPermissionOverwriteâ
readonlyUnknownPermissionOverwrite:10009=10009
UnknownRole
Section titled âUnknownRoleâ
readonlyUnknownRole:10011=10011
UnknownScheduledEvent
Section titled âUnknownScheduledEventâ
readonlyUnknownScheduledEvent:10070=10070
UnknownSticker
Section titled âUnknownStickerâ
readonlyUnknownSticker:10060=10060
UnknownUser
Section titled âUnknownUserâ
readonlyUnknownUser:10013=10013
UnknownWebhook
Section titled âUnknownWebhookâ
readonlyUnknownWebhook:10015=10015