High-level bot framework built on top of [rustigram-api].
This crate provides everything needed to receive and route Telegram updates:
- [
Bot] — entry point, owns the [crate::bot::Bot::client] field and creates a dispatcher - [
Dispatcher] — routes updates to handlers via composable filters - [
Context] — passed to every handler, provides access to the update and the API client - [
filter] — built-in and composable filter predicates - [
handler] — the [handler::Handler] trait and [handler::handler_fn] wrapper - [
state] — [state::StateStorage] for shared data and [state::DialogueStorage] for FSM - [
update_listener] — long-polling and axum-based webhook implementations
Quick start
use ;
use filters;
use handler_fn;
async
async
async
Concurrency model
Each incoming update is dispatched in its own [tokio::spawn] task.
Handlers run concurrently — a slow handler never blocks others.
The dispatcher evaluates routes in registration order and stops at the
first matching filter.