Struct slashy::framework::CommandContext[][src]

pub struct CommandContext {
    pub ctx: Context,
    // some fields omitted
}
Expand description

The context sent to a command’s function Holds arguments, source and Serenity context

Fields

ctx: Context

The Serenity context that was with the event

Implementations

Gets an argument

Gets the value of a String argument

Gets the value of a Integer argument

Gets the value of a Boolean argument

Gets the value of a User argument

Gets the value of a Channel argument

Gets the value of a Role argument

Gets the User that triggered the command

Sends a string in the channel the command was triggered in

Sends a message to the channel the command was triggered in

For Message this is just a wrapper around send_message

For Interaction this sends a ChannelMessageWithSource

Note, we have content be an Option<&str> instead of using a CreateMessage callback as interaction responses use different create message types

Sends a message to the channel the CommandSource is from

Gets the member who triggered the command

Gets the guild the command was triggered in

Gets the guild id the command was triggered in

Gets the channel the command was triggered in

Trait Implementations

Formats the value using the given formatter. 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

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.

Should always be Self

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.