Skip to main content

An asynchronous Python Telegram Bot API wrapper

Project description

TgBee

TgBee is an asynchronous Python wrapper for the Telegram Bot API. It provides a simple and intuitive interface for creating Telegram bots using modern Python features.

Features

  • Asynchronous API calls using aiohttp
  • Easy-to-use decorator-based handler system
  • Support for inline keyboards and callback queries
  • Plugin system for modular bot development
  • FastAPI integration for webhook support

Installation

You can install TgBee using pip:

pip3 install TgBee

Example

import asyncio
from TgBee import Client, filters

bot = Client(
    bot_token = "YOUR_BOT_TOKEN",
    plugins_dir = "source/plugins"
)

@bot.on_message(filters.command("start"))
async def start_command(client, message):
    reply_markup = {
        "inline_keyboard": [
            [
                {"text": "Button 1", "callback_data": "button1"},
                {"text": "Button 2", "callback_data": "button2"}
            ]
        ]
    }

    mention = message.from_user.mention
    sent_message = await client.send_message(
        chat_id=message.chat.id,
        text=f"Welcome {mention} to the bot! Here's a message with some buttons:",
        parse_mode="HTML",
        reply_markup=reply_markup
    )

if __name__ == "__main__":
    asyncio.run(main())

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

tgbee-1.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

TgBee-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file tgbee-1.0.0.tar.gz.

File metadata

  • Download URL: tgbee-1.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tgbee-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d53fa39b2648687dd4c73491451e8876400d79fd48d4cad0f724c30c9af0ae4
MD5 05405875cbf601c23fe26bb5c7902f14
BLAKE2b-256 37a55e89ce5e896af39111061424c59e29c5d114a7108337432412f7b7da8a50

See more details on using hashes here.

File details

Details for the file TgBee-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: TgBee-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for TgBee-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c10e436977f5f0e60dd4e4a7534aa652e9d5f4aca10aa6a0deed7d46ceffc94
MD5 3e05efe84b5d0e8e4f5866b405a4951a
BLAKE2b-256 7a797b38c9566fe74ee0e878901abacbe3c1e72077fcffe141c4d668997956af

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