Skip to main content

handler

Attribute Macro handler 

Source
#[handler]
Expand description

Marks an async function as a rustigram handler.

Generates an impl of the Handler trait and a handler_fn wrapper.

§Example

#[rustigram::handler]
async fn start(ctx: Context) -> BotResult<()> {
    ctx.reply("Hello!").unwrap().await?;
    Ok(())
}