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

A top-level utility structure which can list all of its commands (for use with GuildId::set_commands, etc.) and extract data from CommandInteractions.

Required Methods§

source

fn to_command_data() -> Vec<CreateCommand>

List all of the commands that this type represents.

source

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

Extract data from a serenity::all::CommandData.

Errors

Returns an error if the implementation fails.

Object Safety§

This trait is not object safe.

Implementors§