Trait serenity_commands::Commands

source ·
pub trait Commands: Sized {
    // Required methods
    fn create_commands() -> Vec<CreateCommand>;
    fn from_command_data(data: &CommandData) -> Result<Self>;
}
Expand description

A utility for creating commands and extracting their data from application commands.

Required Methods§

source

fn create_commands() -> Vec<CreateCommand>

List of top-level commands.

source

fn from_command_data(data: &CommandData) -> Result<Self>

Extract data from CommandData.

§Errors

Returns an error if the implementation fails.

Object Safety§

This trait is not object safe.

Implementors§