Trait serenity_commands::Command
source · pub trait Command: Sized {
// Required methods
fn create_command(
name: impl Into<String>,
description: impl Into<String>
) -> CreateCommand;
fn from_options(options: &[CommandDataOption]) -> Result<Self>;
}
Expand description
A top-level command for use with Commands
.
Required Methods§
sourcefn create_command(
name: impl Into<String>,
description: impl Into<String>
) -> CreateCommand
fn create_command( name: impl Into<String>, description: impl Into<String> ) -> CreateCommand
Create the command.
sourcefn from_options(options: &[CommandDataOption]) -> Result<Self>
fn from_options(options: &[CommandDataOption]) -> Result<Self>
Extract data from a list of CommandDataOption
s.
Errors
Returns an error if the implementation fails.
Object Safety§
This trait is not object safe.