Enum twilight_http::api_error::ErrorCode[][src]

#[non_exhaustive]
pub enum ErrorCode {
Show variants GeneralError, UnknownAccount, UnknownApplication, UnknownChannel, UnknownGuild, UnknownIntegration, UnknownInvite, UnknownMember, UnknownMessage, UnknownPermissionOverwrite, UnknownProvider, UnknownRole, UnknownToken, UnknownUser, UnknownEmoji, UnknownWebhook, UnknownWebhookService, UnknownSession, UnknownBan, UnknownSKU, UnknownStoreListing, UnknownEntitlement, UnknownBuild, UnknownLobby, UnknownBranch, UnknownStoreDirectoryLayout, UnknownRedistributable, UnknownGiftCode, UnknownGuildTemplate, UnknownInteraction, UnknownApplicationCommand, UnknownApplicationCommandPermissions, BotsCannotUseEndpoint, OnlyBotsCanUseEndpoint, ExplicitContentSendingBlocked, UnauthorizedApplicationAction, SlowModeRateLimitReached, NotAccountOwner, AnnouncementRateLimitReached, ChannelRateLimitReached, UnallowedWordsForPublicStage, MaximumGuildsReached, MaximumFriendsReached, MaximumPinsReached, MaximumRecipientsReached, MaximumRolesReached, MaximumWebhooksReached, MaximumEmojisReached, MaximumReactionsReached, MaximumGuildChannelsReached, MaximumAttachmentsReached, MaximumInvitesReached, MaximumAnimatedEmojisReached, MaximumGuildMembersReached, GuildTemplateAlreadyExist, MaximumNonGuildBansReached, MaximumGuildBansFetchesReached, Unauthorized, AccountNeedsVerification, OpeningDirectMessageRateLimitReached, RequestEntityTooLarge, FeatureTemporarilyDisabled, UserBannedFromGuild, UserNotInVoice, MessageAlreadyCrossposted, CommandNameAlreadyExists, Missingaccess, InvalidAccountType, InvalidDMChannelAction, GuildWidgetDisabled, MessageNotAuthoredByUser, EmptyMessage, CannotSendMessageToUser, CannotSendMessagesInVoiceChannel, VerificationLevelTooHigh, OAuthApplicationHasNoBot, OAuthApplicationLimitReached, InvalidOAuthSstate, PermissionsLacking, InvalidAuthenticationTokenProvided, NoteTooLong, InvalidMessageDeleteRange, MessagePinnedInWrongChannel, InviteCodeInvalidOrTaken, InvalidActionOnSystemMessage, CannotExecuteActionOnChannelType, InvalidOAuthAccessToken, MissingOAuthScope, InvalidWebhookToken, InvalidRole, InvalidRecipient, MessageTooOldToBulkDelete, InvalidFormBodyOrContentType, InviteAcceptedToGuildBotNotIn, InvalidApiVersion, CannotSelfRedeemGift, PaymentRequiredForGift, CommunityGuildRequired, InvalidStickerSent, TwoFactorRequired, NoSuchUser, ReactionBlocked, ApiResourceOverloaded, Other(u64),
}

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
GeneralError

General error (such as a malformed request body, amongst other things)

UnknownAccount

Unknown account

UnknownApplication

Unknown application

UnknownChannel

Unknown channel

UnknownGuild

Unknown guild

UnknownIntegration

Unknown integration

UnknownInvite

Unknown invite

UnknownMember

Unknown member

UnknownMessage

Unknown message

UnknownPermissionOverwrite

Unknown permission overwrite

UnknownProvider

Unknown provider

UnknownRole

Unknown role

UnknownToken

Unknown token

UnknownUser

Unknown user

UnknownEmoji

Unknown emoji

UnknownWebhook

Unknown webhook

UnknownWebhookService

Unknown webhook service

UnknownSession

Unknown session

UnknownBan

Unknown ban

UnknownSKU

Unknown SKU

UnknownStoreListing

Unknown Store Listing

UnknownEntitlement

Unknown entitlement

UnknownBuild

Unknown build

UnknownLobby

Unknown lobby

UnknownBranch

Unknown branch

UnknownStoreDirectoryLayout

Unknown store directory layout

UnknownRedistributable

Unknown redistributable

UnknownGiftCode

Unknown gift code

UnknownGuildTemplate

Unknown guild template

UnknownInteraction

Unknown interaction

UnknownApplicationCommand

Unknown application command

UnknownApplicationCommandPermissions

Unknown application command permissions

BotsCannotUseEndpoint

Bots cannot use this endpoint

OnlyBotsCanUseEndpoint

Only bots can use this endpoint

ExplicitContentSendingBlocked

Explicit content cannot be sent to the desired recipient(s)

UnauthorizedApplicationAction

You are not authorized to perform this action on this application

SlowModeRateLimitReached

This action cannot be performed due to slowmode rate limit

NotAccountOwner

Only the owner of this account can perform this action

AnnouncementRateLimitReached

Message cannot be edited due to announcement rate limits

ChannelRateLimitReached

The channel you are writing has hit the write rate limit

UnallowedWordsForPublicStage

Your Stage topic contains words that are not allowed for public Stages

MaximumGuildsReached

Maximum number of guilds reached (100)

MaximumFriendsReached

Maximum number of friends reached (1000)

MaximumPinsReached

Maximum number of pins reached for the channel (50)

MaximumRecipientsReached

Maximum number of recipients reached (10)

MaximumRolesReached

Maximum number of guild roles reached (250)

MaximumWebhooksReached

Maximum number of webhooks reached (10)

MaximumEmojisReached

Maximum number of emojis reached

MaximumReactionsReached

Maximum number of reactions reached (20)

MaximumGuildChannelsReached

Maximum number of guild channels reached (500)

MaximumAttachmentsReached

Maximum number of attachments in a message reached (10)

MaximumInvitesReached

Maximum number of invites reached (1000)

MaximumAnimatedEmojisReached

Maximum number of animated emojis reached

MaximumGuildMembersReached

Maximum number of server members reached

GuildTemplateAlreadyExist

Guild already has a template

MaximumNonGuildBansReached

Maximum number of bans for non-guild members have been exceeded

MaximumGuildBansFetchesReached

Maximum number of bans fetches has been reached

Unauthorized

Unauthorized. Provide a valid token and try again

AccountNeedsVerification

You need to verify your account in order to perform this action

OpeningDirectMessageRateLimitReached

You are opening direct messages too fast

RequestEntityTooLarge

Request entity too large. Try sending something smaller in size

FeatureTemporarilyDisabled

This feature has been temporarily disabled server-side

UserBannedFromGuild

The user is banned from this guild

UserNotInVoice

Target user is not connected to voice

MessageAlreadyCrossposted

This message has already been crossposted

CommandNameAlreadyExists

An application command with that name already exists

Missingaccess

Missing access

InvalidAccountType

Invalid account type

InvalidDMChannelAction

Cannot execute action on a DM channel

GuildWidgetDisabled

Guild widget disabled

MessageNotAuthoredByUser

Cannot edit a message authored by another user

EmptyMessage

Cannot send an empty message

CannotSendMessageToUser

Cannot send messages to this user

CannotSendMessagesInVoiceChannel

Cannot send messages in a voice channel

VerificationLevelTooHigh

Channel verification level is too high for you to gain access

OAuthApplicationHasNoBot

OAuth2 application does not have a bot

OAuthApplicationLimitReached

OAuth2 application limit reached

InvalidOAuthSstate

Invalid OAuth2 state

PermissionsLacking

You lack permissions to perform that action

InvalidAuthenticationTokenProvided

Invalid authentication token provided

NoteTooLong

Note was too long

InvalidMessageDeleteRange

Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete

MessagePinnedInWrongChannel

A message can only be pinned to the channel it was sent in

InviteCodeInvalidOrTaken

Invite code was either invalid or taken

InvalidActionOnSystemMessage

Cannot execute action on a system message

CannotExecuteActionOnChannelType

Cannot execute action on this channel type

InvalidOAuthAccessToken

Invalid OAuth2 access token provided

MissingOAuthScope

Missing required OAuth2 scope

InvalidWebhookToken

Invalid webhook token provided

InvalidRole

Invalid role

InvalidRecipient

Invalid recipient(s)

MessageTooOldToBulkDelete

A message provided was too old to bulk delete

InvalidFormBodyOrContentType

Invalid form body (returned for both application/json and multipart/form-data bodies), or invalid Content-Type provided

InviteAcceptedToGuildBotNotIn

An invite was accepted to a guild the application’s bot is not in

InvalidApiVersion

Invalid API version provided

CannotSelfRedeemGift

Cannot self-redeem this gift

PaymentRequiredForGift

Payment source required to redeem gift

CommunityGuildRequired

Cannot delete a channel required for Community guilds

InvalidStickerSent

Invalid sticker sent

TwoFactorRequired

Two factor is required for this operation.

NoSuchUser

No users with DiscordTag exist

ReactionBlocked

Reaction was blocked

ApiResourceOverloaded

API resource is currently overloaded. Try again a little later

Other(u64)

A status code that Twilight doesn’t have registered.

Please report the number if you see this variant!

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.