Trait serenity_commands::CommandData
source · 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
CommandInteraction
s.
Required Methods§
sourcefn to_command_data() -> Vec<CreateCommand>
fn to_command_data() -> Vec<CreateCommand>
List all of the commands that this type represents.
sourcefn from_command_data(data: &CommandData) -> Result<Self>
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.