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 -U 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.1.tar.gz (12.3 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.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tgbee-1.0.1.tar.gz
  • Upload date:
  • Size: 12.3 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.1.tar.gz
Algorithm Hash digest
SHA256 a0cdfd65813ff83742ae4312d433f4bcca101f34e48a1320e279fa3d50252bf0
MD5 85b7ef139c8248e75b09e041a80882be
BLAKE2b-256 cec3fae8b1ad58ee6442ef5522aa04d2c16aa2d57e78612f1ac3c6dcdec5d457

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TgBee-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09cd805caf8f6381e320e52404bd9fcf67dadd8364810ed4dafaa1a379d40725
MD5 4a5790f9f7b2a796f32340a9a255e15a
BLAKE2b-256 30687afd7ec03e28011acd2dae783e632fd63545c5dd1d4cd1b28f0f979d9c97

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