An open API service indexing awesome lists of open source software.

https://github.com/timoniq/telegrinder

Modern visionary telegram bot framework
https://github.com/timoniq/telegrinder

async bot chatbot framework telegram

Last synced: about 2 months ago
JSON representation

Modern visionary telegram bot framework

Awesome Lists containing this project

README

          






Logo



telegrinder


— effective and reliable telegram bot building.



GitHub License
Code Style
Type Checker
Python versions
Telegram Bot API Version

* Type hinted & [type functional](https://github.com/timoniq/telegrinder/blob/dev/docs/tutorial/en/3_functional_bits.md)
* Customizable and extensible
* Fast models built on [msgspec](https://github.com/jcrist/msgspec)
* API client powered by fast [wreq](https://github.com/0x676e67/wreq-python) library
* Both low-level and high-level API
* Convenient [dependency injection](https://github.com/timoniq/telegrinder/blob/dev/docs/tutorial/en/5_nodes.md) via nodes
* A variety of state management tools

waiter machine for runtime inline short state funneling
state mutator to declare complex state sets

Basic example:

```python
from telegrinder import API, Message, Telegrinder, Token
from telegrinder.modules import setup_logger
from telegrinder.rules import Text

setup_logger(level="INFO")
api = API(token=Token("123:token"))
bot = Telegrinder(api)

@bot.on.message(Text("/start"))
async def start(message: Message) -> None:
me = (await api.get_me()).unwrap()
await message.answer(f"Hello, {message.from_user.full_name}! I'm {me.full_name}.")

bot.run_forever()
```

# Getting started

Install using pip, uv or poetry:

PyPI Version

```console
uv add telegrinder
poetry add telegrinder
pip install telegrinder
```

Or install from source (unstable):

GitHub CI

```console
uv add "telegrinder @ git+https://github.com/timoniq/telegrinder@dev"
poetry add git+https://github.com/timoniq/telegrinder@dev
pip install git+https://github.com/timoniq/telegrinder@dev
```

# Documentation

[**Tutorial 📖**](/docs/tutorial/en/0_tutorial.md)

# Community

Join one of our [forums](https://github.com/timoniq/telegrinder/blob/dev/docs/community_links.md).

# License

Telegrinder is [MIT licensed](./LICENSE)\
Copyright © 2022 [timoniq](https://github.com/timoniq)\
Copyright © 2024 [luwqz1](https://github.com/luwqz1)

# Contributors



\


We welcome your pull requests ([contrubution notes](https://github.com/timoniq/telegrinder/blob/main/contributing.md)). Telegrinder is built by the community