Attribute Macro telexide::prelude::command [−][src]
#[command]
A function attribute macro for making commands.
This macro will prepare your commands, which can then be added to your framework using
the create_framework!
macro in telexide itself.
Options
To alter how the macro will interpret the command, you can provide options as arguments provided to the macro.
ⓘ
#[command(description = "the command description")] async fn hello(ctx: Context, message: Message) { ... }
Option | Usage | Description |
---|---|---|
Description | description = “your description” | The description of the command as to be displayed in telegram, 3-256 characters |
Name | name = “the command name” | The name to be used within telegram, 1-32 characters |
Notes
- The description argument is required, because telegram requires it for a command to be displayed there.
- The name argument defaults to the name of the command if not provided