ferrisgram 0.2.1

An elegent rust client for the Telegram Bot API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use async_trait::async_trait;
use dyn_clone::{clone_trait_object, DynClone};

use crate::ext::Context;
use crate::types::Update;
use crate::{error::GroupIteration, error::Result, Bot};

#[async_trait]
pub trait Handler: Send + Sync + DynClone {
    async fn check_update(&self, bot: &Bot, update: &Update) -> bool;
    async fn handle_update(&self, bot: &Bot, context: &Context) -> Result<GroupIteration>;
}

clone_trait_object!(Handler);