Trait serenity_commands::Command
source · 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§
sourcefn to_command(
name: impl Into<String>,
description: impl Into<String>
) -> CreateCommand
fn to_command( name: impl Into<String>, description: impl Into<String> ) -> CreateCommand
Create the command.
sourcefn from_command(options: &[CommandDataOption]) -> Result<Self>
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.