toby 0.1.3

A simple, opinionated Telegram bot library with structured command parsing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use anyhow::anyhow;
use std::{future::Future, pin::Pin};
use toby::{Msg, ReplyMsg, Toby};

fn handle_msg(_msg: &Msg) -> Pin<Box<dyn Future<Output = anyhow::Result<ReplyMsg>> + Send>> {
    Box::pin(async move { Err(anyhow!("todo")) })
}

#[tokio::main]
async fn main() {
    let token = "<TELEGRAM_TOKEN_HERE>";

    Toby::new(token, handle_msg).listen().await;
}