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

A top-level command for use with CommandData. The command may contain regular options, sub-commands, and sub-command groups.

Required Methods§

source

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

Create the command.

source

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

Extract this command’s data from an option list.

Errors

Returns an error if the implementation fails.

Object Safety§

This trait is not object safe.

Implementors§