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

#[non_exhaustive]pub enum ErrorCode {
    GeneralError,
    UnknownAccount,
    UnknownApplication,
    UnknownChannel,
    UnknownGuild,
    UnknownIntegration,
    UnknownInvite,
    UnknownMember,
    UnknownMessage,
    UnknownPermissionOverwrite,
    UnknownProvider,
    UnknownRole,
    UnknownToken,
    UnknownUser,
    UnknownEmoji,
    UnknownWebhook,
    UnknownBan,
    UnknownSKU,
    UnknownStoreListing,
    UnknownEntitlement,
    UnknownBuild,
    UnknownLobby,
    UnknownBranch,
    UnknownRedistributable,
    BotsCannotUseEndpoint,
    OnlyBotsCanUseEndpoint,
    MaximumGuildsReached,
    MaximumFriendsReached,
    MaximumPinsReached,
    MaximumRolesReached,
    MaximumWebhooksReached,
    MaximumReactionsReached,
    MaximumGuildChannelsReached,
    MaximumAttachmentsReached,
    MaximumInvitesReached,
    Unauthorized,
    AccountNeedsVerification,
    RequestEntityTooLarge,
    FeatureTemporarilyDisabled,
    UserBannedFromGuild,
    Missingaccess,
    InvalidAccountType,
    InvalidDMChannelAction,
    GuildWidgetDisabled,
    MessageNotAuthoredByUser,
    EmptyMessage,
    CannotSendMessageToUser,
    CannotSendMessagesInVoiceChannel,
    VerificationLevelTooHigh,
    OAuthApplicationHasNoBot,
    OAuthApplicationLimitReached,
    InvalidOAuthSstate,
    PermissionsLacking,
    InvalidAuthenticationTokenProvided,
    NoteTooLong,
    InvalidMessageDeleteRange,
    MessagePinnedInWrongChannel,
    InviteCodeInvalidOrTaken,
    InvalidActionOnSystemMessage,
    InvalidOAuthAccessToken,
    MessageTooOldToBulkDelete,
    InvalidFormBodyOrContentType,
    InviteAcceptedToGuildBotNotIn,
    InvalidApiVersion,
    ReactionBlocked,
    ApiResourceOverloaded,
    Other(u64),
}

Variants (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

UnknownBan

Unknown ban

UnknownSKU

Unknown SKU

UnknownStoreListing

Unknown Store Listing

UnknownEntitlement

Unknown entitlement

UnknownBuild

Unknown build

UnknownLobby

Unknown lobby

UnknownBranch

Unknown branch

UnknownRedistributable

Unknown redistributable

BotsCannotUseEndpoint

Bots cannot use this endpoint

OnlyBotsCanUseEndpoint

Only bots can use this endpoint

MaximumGuildsReached

Maximum number of guilds reached (100)

MaximumFriendsReached

Maximum number of friends reached (1000)

MaximumPinsReached

Maximum number of pins reached for the channel (50)

MaximumRolesReached

Maximum number of guild roles reached (250)

MaximumWebhooksReached

Maximum number of webhooks reached (10)

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)

Unauthorized

Unauthorized. Provide a valid token and try again

AccountNeedsVerification

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

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

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

InvalidOAuthAccessToken

Invalid OAuth2 access token provided

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

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

impl ErrorCode[src]

pub fn num(&self) -> u64[src]

Trait Implementations

impl Clone for ErrorCode[src]

impl Copy for ErrorCode[src]

impl Debug for ErrorCode[src]

impl<'de> Deserialize<'de> for ErrorCode[src]

impl Display for ErrorCode[src]

impl Eq for ErrorCode[src]

impl From<u64> for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl Serialize for ErrorCode[src]

impl StructuralEq for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

Auto Trait Implementations

impl RefUnwindSafe for ErrorCode

impl Send for ErrorCode

impl Sync for ErrorCode

impl Unpin for ErrorCode

impl UnwindSafe for ErrorCode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.