Create derive macro for the CreateCommand trait. This will introduce a #[command] attribute. All struct fields must be documented (doc comment or desc attribute).
use twilight_interactions::{CommandModel, CreateCommand, ResolvedUser};
/// Say hello with a message
#[derive(CommandModel, CreateCommand)]
#[command(name = "hello", default_permission = true)
struct HelloCommand {
#[command(desc = "Your message.")
message: String,
/// The member to send the message to.
#[command(rename = "member")
user: Option<ResolvedUser>
}
Create derive macro for the
CreateCommand
trait. This will introduce a#[command]
attribute. All struct fields must be documented (doc comment ordesc
attribute).