Derive Macro Commands

Source
#[derive(Commands)]
{
    // Attributes available to this derive:
    #[command]
}
Expand description

Derives Commands.

ยงExamples

Each field of named variants must implement Command.

The inner type of newtype variants must implement Command.

use serenity_commands::{Command, Commands};

#[derive(Command)]
enum MathCommand {
    // ...
}

#[derive(Commands)]
enum AllCommands {
    /// Ping the bot.
    Ping,

    /// Echo a message.
    Echo {
        /// The message to echo.
        message: String,
    },

    /// Do math operations.
    Math(MathCommand),
}