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 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
pub async fn send_embed<F>(&self, embed: F) -> Result<()> where
F: Fn(&mut CreateEmbed) -> &mut CreateEmbed,
[src]
pub async fn send_embed<F>(&self, embed: F) -> Result<()> where
F: Fn(&mut CreateEmbed) -> &mut CreateEmbed,
[src]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
pub async fn send_message<'a, F>(&self, f: F) -> Result<Message> where
F: FnOnce(&'b mut CreateMessage<'a>) -> &'b mut CreateMessage<'a>,
[src]
pub async fn send_message<'a, F>(&self, f: F) -> Result<Message> where
F: FnOnce(&'b mut CreateMessage<'a>) -> &'b mut CreateMessage<'a>,
[src]Sends a message to the channel the CommandSource is from
Gets the guild the command was triggered in
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl !UnwindSafe for CommandContext