Derive Macro serenity_commands::SubcommandGroup

source ·
#[derive(SubcommandGroup)]
{
    // Attributes available to this derive:
    #[command]
}
Expand description

Derives SubcommandGroup.

Each field of named variants must implement BasicOption.

The inner type of newtype variants must implement Subcommand.

§Examples

use serenity_commands::{Subcommand, SubcommandGroup};

#[derive(Subcommand)]
struct AddSubcommand {
    /// First number.
    a: f64,

    /// Second number.
    b: f64,
}

#[derive(SubcommandGroup)]
enum Math {
    /// Add two numbers.
    Add(AddSubcommand),

    /// Negate a number.
    Negate {
        /// The number to negate.
        a: f64,
    },
}