[][src]Attribute Macro telexide::prelude::command

#[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.

This example is not tested
#[command(description = "the command description")]
async fn hello(ctx: Context, message: Message) { ... }
OptionUsageDescription
Descriptiondescription = "your description"The description of the command as to be displayed in telegram, 3-256 characters
Namename = "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