Skip to main content

command

Attribute Macro command 

Source
#[command]
Expand description

Attribute macro for declaring Telegram bot command handler functions.

Wraps a command handler function, enabling automated routing and metadata extraction.

§Examples

ⓘ
#[telegram_rs_2::command("/start")]
async fn handle_start(bot: Bot, msg: Message) {
    // Handle /start
}