pub trait Command: Sized {
    // Required methods
    fn create_command(
        name: impl Into<String>,
        description: impl Into<String>
    ) -> CreateCommand;
    fn from_options(options: &[CommandDataOption]) -> Result<Self>;
}
Expand description

A top-level command for use with Commands.

Required Methods§

source

fn create_command( name: impl Into<String>, description: impl Into<String> ) -> CreateCommand

Create the command.

source

fn from_options(options: &[CommandDataOption]) -> Result<Self>

Extract data from a list of CommandDataOptions.

Errors

Returns an error if the implementation fails.

Object Safety§

This trait is not object safe.

Implementors§