Reusable Telegram bot framework with Clean Architecture
Project description
Bot Framework
Reusable Python library for building Telegram bots with Clean Architecture principles.
Installation
# Basic installation
pip install bot-framework
# With Telegram support
pip install bot-framework[telegram]
# With all optional dependencies
pip install bot-framework[all]
Features
- Clean Architecture - Layered architecture with import-linter enforcement
- Telegram Integration - Ready-to-use services for pyTelegramBotAPI
- Flow Management - Dialog flow stack management with Redis storage
- Role Management - User roles and permissions
- Language Management - Multilingual phrase support
- Request Role Flow - Pre-built flow for role requests
Quick Start
from bot_framework import Button, Keyboard, IMessageSender
from bot_framework.telegram import TelegramMessageSender
# Create keyboard
keyboard = Keyboard(rows=[
[Button(text="Option 1", callback_data="opt1")],
[Button(text="Option 2", callback_data="opt2")],
])
# Send message (implement IMessageSender or use TelegramMessageSender)
sender.send(chat_id=123, text="Choose an option:", keyboard=keyboard)
Optional Dependencies
telegram- pyTelegramBotAPI for Telegram bot integrationpostgres- psycopg for PostgreSQL database supportredis- Redis for caching and flow state managementall- All optional dependencies
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bot_framework-0.1.3.tar.gz
(24.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bot_framework-0.1.3.tar.gz.
File metadata
- Download URL: bot_framework-0.1.3.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f0429c2b70bec224f0cff454b50924e424c2aeb2343d621e1340d27c8db09b
|
|
| MD5 |
3abc93208e2f97953a37782a2ee2b227
|
|
| BLAKE2b-256 |
e4790784a131cb628bfb5606b51a3ca0b54405ca5887c57a74cf71caf9e0de69
|
File details
Details for the file bot_framework-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bot_framework-0.1.3-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fabbaebbb928ebec07b5066b993ba4793de000e768d52e2d254077f2a41597fc
|
|
| MD5 |
9f31f3f3a07927ca45b12d35696ba674
|
|
| BLAKE2b-256 |
414cc79f1e9d6c5eee00e026f678a9be332b0a31a27b6fe9d646e28cd26527d7
|