— effective and reliable telegram bot building.
- Type hinted & type functional
- Customizable and extensible
- Fast models built on msgspec
- Both low-level and high-level API
- Convenient dependency injection 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:
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()Install using pip, uv or poetry:
uv add telegrinder
poetry add telegrinder
pip install telegrinderOr install from source (unstable):
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@devJoin one of our forums.
Telegrinder is MIT licensed
Copyright © 2022 timoniq
Copyright © 2024 luwqz1
We welcome your pull requests (contrubution notes). Telegrinder is built by the community
