Skip to main content

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 integration
  • postgres - psycopg for PostgreSQL database support
  • redis - Redis for caching and flow state management
  • all - All optional dependencies

License

MIT

Project details


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.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bot_framework-0.1.0-py3-none-any.whl (62.6 kB view details)

Uploaded Python 3

File details

Details for the file bot_framework-0.1.0.tar.gz.

File metadata

  • Download URL: bot_framework-0.1.0.tar.gz
  • Upload date:
  • Size: 24.9 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

Hashes for bot_framework-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3525ebdfabf438846f7fb0d3b0a93298cd2e94f026e140282e47399b9ea9802b
MD5 34bf2763fbb5ead5b12d1d987821a8cf
BLAKE2b-256 aa5ac6b92cc3ba8dbb01ad7f4206b7f64a43da0071007f50df15795b7ffa3a52

See more details on using hashes here.

File details

Details for the file bot_framework-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bot_framework-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 62.6 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

Hashes for bot_framework-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b661d7d16212902c9164a641af372405847e7de794a85279743d64add47e75cb
MD5 35bd42699539ec4f649bf9145053aaeb
BLAKE2b-256 ce1f6b8722ed172be8cc981f2ceb628f7b31cfc3ce4b56d526dacefb635dfbbc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page