pub trait SlashCommand: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn register(&self) -> CreateCommand;
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
command: CommandInteraction,
config: Config,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for slash commands.
Required Methods§
Sourcefn register(&self) -> CreateCommand
fn register(&self) -> CreateCommand
Register the command with Discord.