Skip to main content

dispatch

Function dispatch 

Source
pub async fn dispatch(ctx: PluginContext) -> Result<(), RequestError>
Examples found in repository?
examples/bot.rs (line 8)
5async fn handle_message(bot: Bot, msg: Message) -> ResponseResult<()> {
6    println!("message: {:?}", msg);
7    let ctx = PluginContext::new(bot.clone(), Some(msg.clone()), None);
8    let _ = dispatch(ctx).await;
9    Ok(())
10}
11
12async fn handle_callback_query(bot: Bot, cq: CallbackQuery) -> ResponseResult<()> {
13    println!("callback query: {:?}", cq);
14    let ctx = PluginContext::new(bot.clone(), None, Some(cq.clone()));
15    let _ = dispatch(ctx).await;
16    Ok(())
17}