#telegram-bot #telegram #bot-api #bot

telers

An asynchronous framework for Telegram Bot API written in Rust

17 releases

1.0.0-alpha.17 Apr 5, 2024
1.0.0-alpha.16 Feb 29, 2024
1.0.0-alpha.13 Jan 8, 2024
1.0.0-alpha.12 Dec 5, 2023
1.0.0-alpha.3 Jul 12, 2023

#8 in #bot-api

Download history 6/week @ 2024-01-06 19/week @ 2024-02-03 11/week @ 2024-02-17 137/week @ 2024-02-24 23/week @ 2024-03-02 19/week @ 2024-03-09 22/week @ 2024-03-16 105/week @ 2024-03-30 350/week @ 2024-04-06 8/week @ 2024-04-13

463 downloads per month
Used in telers-macros

MIT/Apache

1.5MB
40K SLoC

telers

An asynchronous framework for Telegram Bot API written in Rust

Telers make it easy to create Telegram bots in Rust.

Before you start, make sure that you have a basic understanding of the Telegram Bot API, because types and methods in the library have the same fields and types as in the documentation.

Highlights

  • Asynchronous. Built on top of Tokio, a powerful asynchronous runtime.
  • Easy to use. Provides a simple and intuitive API for creating bots.
  • Based on aiogram. Inspired by the framework written in Python and tries to provide a similar functionality.
  • Routers, Middlewares, Filters and Handlers. Provides a powerful system of routers, middlewares, filters and handlers to make your code more readable and maintainable, and simplify the creation of bots.
  • Extractors. Have similar system of extractors as in axum and actix.

Examples

  • Echo bot. This example shows how to create an echo bot.
  • Text formatting. This example shows how to format text.
  • Text case filters. This example shows how to create text case filters.
  • Stats updates middleware. This example shows how to create a middleware that count incoming updates.
  • Context. This example shows how to extract data from event and context and use it in handlers.
  • Input file. This example shows how to send files by the bot.
  • 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 an echo bot and run it concurrently 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

Dependencies

~11–26MB
~404K SLoC