[][src]Trait serenity::framework::standard::Command

pub trait Command: Send + Sync + 'static {
    fn execute(
        &self,
        _: &mut Context,
        _: &Message,
        _: Args
    ) -> Result<(), Error>; fn options(&self) -> Arc<CommandOptions> { ... }
fn init(&self) { ... }
fn before(&self, &mut Context, &Message) -> bool { ... }
fn after(&self, &mut Context, &Message, &Result<(), Error>) { ... } }

A framework command.

Required methods

fn execute(&self, _: &mut Context, _: &Message, _: Args) -> Result<(), Error>

Loading content...

Provided methods

fn options(&self) -> Arc<CommandOptions>

fn init(&self)

Called when the command gets registered.

fn before(&self, &mut Context, &Message) -> bool

"before" middleware. Is called alongside the global middleware in the framework.

fn after(&self, &mut Context, &Message, &Result<(), Error>)

"after" middleware. Is called alongside the global middleware in the framework.

Loading content...

Implementations on Foreign Types

impl Command for Arc<dyn Command>[src]

Loading content...

Implementors

impl<F: ?Sized> Command for F where
    F: Fn(&mut Context, &Message, Args) -> Result<(), Error> + Send + Sync + 'static, 
[src]

fn options(&self) -> Arc<CommandOptions>[src]

fn init(&self)[src]

fn before(&self, &mut Context, &Message) -> bool[src]

fn after(&self, &mut Context, &Message, &Result<(), Error>)[src]

Loading content...