Crate mogram

source ·
Expand description

mobot is a Telegram Bot framework for Rust.

It supports the full Telegram Bot API, and provides a simple framework around managing routing and state for your bot.

Example

use mogram::*;

#[tokio::main]
async fn main() {
    let client = Client::new(std::env::var("TELEGRAM_TOKEN").unwrap().into());
    let mut router = Router::new(client);

    router.add_chat_handler(|_, _: ()| async move {
        Ok(chat::Action::ReplyText("Hello world!".into()))
    });
    router.start().await;
}

Re-exports

Modules

Functions