telers
An asynchronous framework for Telegram Bot API written in Rust
Telers make it easy to create Telegram bots in Rust.
Make sure you have a basic understanding of the Telegram Bot API before you start, because all types and methods in telers have the same fields and types as in Telegram Bot API.
Highlights
- Asynchronous. Telers is built on top of Tokio, a powerful asynchronous runtime for Rust.
- Easy to use. Telers provides a simple and intuitive API to create Telegram bots.
- Based on aiogram. Telers is inspired by aiogram, a Python framework for Telegram Bot API. Telers tries to provide the same API as aiogram, so if you know aiogram, you can easily start using this framework.
- Middlewares, Filters and Handlers. Telers provides a powerful system of middlewares, filters and handlers. You can use middlewares to modify incoming/outgoing updates (logging, database connections, etc.), filters to filter incoming updates and handlers to handle incoming updates.
- Powerful extractors. Telers provides a simple system of extractors. You can use extractors to extract data from incoming updates and context (middlewares, filters, etc.), and pass it to your handlers directly.
- Multiple bots. Telers allows you to create multiple bots in one application without any problems.
Examples
- Echo bot. This example shows how to create a echo bot.
- Text case filters. This example shows how to create text case filters.
- Stats updates middleware. This example shows how to create a middleware that counter incoming updates.
- Finite state machine. This example shows how to use a finite state machine (conversation).
- Router tree. This example shows how to create a router tree.
- Bot http client. This example shows how to set a custom bot HTTP client.
- Axum and echo bot. This example shows how to create a echo bot and how to run it parallel with polling axum server.
You may consider checking out this directory for more examples.
Community
Telegram
License
This project is licensed under either of the following licenses, at your option:
- Apache License, Version 2.0
- MIT License