[][src]Enum serenity::framework::standard::DispatchError

#[non_exhaustive]pub enum DispatchError {
    CheckFailed(&'static strReason),
    Ratelimited(Duration),
    CommandDisabled(String),
    BlockedUser,
    BlockedGuild,
    BlockedChannel,
    OnlyForDM,
    OnlyForGuilds,
    OnlyForOwners,
    LackingRole,
    LackingPermissions(Permissions),
    NotEnoughArguments {
        min: u16,
        given: usize,
    },
    TooManyArguments {
        max: u16,
        given: usize,
    },
}

An enum representing all possible fail conditions under which a command won't be executed.

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.
CheckFailed(&'static strReason)

When a custom function check has failed.

Ratelimited(Duration)

When the command requester has exceeded a ratelimit bucket. The attached value is the time a requester has to wait to run the command again.

CommandDisabled(String)

When the requested command is disabled in bot configuration.

BlockedUser

When the user is blocked in bot configuration.

BlockedGuild

When the guild or its owner is blocked in bot configuration.

BlockedChannel

When the channel blocked in bot configuration.

OnlyForDM

When the requested command can only be used in a direct message or group channel.

OnlyForGuilds

When the requested command can only be ran in guilds, or the bot doesn't support DMs.

OnlyForOwners

When the requested command can only be used by bot owners.

LackingRole

When the requested command requires one role.

LackingPermissions(Permissions)

When the command requester lacks specific required permissions.

NotEnoughArguments

When there are too few arguments.

Fields of NotEnoughArguments

min: u16given: usize
TooManyArguments

When there are too many arguments.

Fields of TooManyArguments

max: u16given: usize

Trait Implementations

impl Debug for DispatchError[src]

Auto Trait Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]