Skip to main content

PyBotRex simplifies Telegram bot creation with a clean and intuitive interface for commands, messaging, buttons, and more.

Project description

PyRexBot

PyRexBot Logo

PyRexBot simplifies Telegram bot development with an intuitive interface for commands, messaging, buttons, and more. Build interactive Telegram bots effortlessly, from basic to advanced, with clean and reusable code.


🚀 Features

  • Easy Command Handling: Add commands with simple callbacks.
  • Message Processing: Handle messages with text or media filters.
  • Interactive Buttons: Create inline keyboard buttons with ease.
  • Advanced Functionalities: Support for inline queries, message editing, file sharing, and more.
  • Fully Asynchronous: Built on python-telegram-bot 20.0+ for fast and reliable performance.
  • Error Handling: Add custom global error handlers for debugging.

🛠 Installation

Install PyRexBot using pip:

pip install PyRexBot

📦 Quick Start

Here’s how you can build a basic bot in minutes:

from PyRexBot import PyRexBot

# Initialize the bot
bot = PyRexBot("YOUR_TELEGRAM_BOT_TOKEN")

# Define a command
async def start_command(update, context):
    await bot.reply(update, "Welcome to PyRexBot!")

# Add the command
bot.add_command("start", start_command)

# Run the bot
bot.start()

📚 Examples

1. Adding Inline Buttons

async def button_example(update, context):
    buttons = [("Click Me", "button_callback")]
    await bot.reply(update, "Here's a button!", buttons=buttons)

bot.add_command("button", button_example)

2. Sending Media (Photo)

async def send_photo_example(update, context):
    await bot.send_photo(update.message.chat_id, "https://example.com/image.jpg", caption="Look at this!")

bot.add_command("photo", send_photo_example)

3. Handling Inline Queries

async def inline_query_handler(update, context):
    # Handle inline query logic here
    pass

bot.add_inline_query_handler(inline_query_handler)

🛠 Full API Reference

Core Methods:

  • add_command(name: str, callback): Add a new command (e.g., /start).
  • add_message_handler(callback, text_only=True): Handle text or media messages.
  • add_button_handler(callback): Handle inline button clicks.
  • add_inline_query_handler(callback): Handle inline queries.
  • send_message(chat_id, text, buttons=None): Send a message with optional buttons.
  • send_photo(chat_id, photo, caption=None, buttons=None): Send a photo with optional caption and buttons.
  • reply(update, text, buttons=None): Reply to a user’s message.
  • edit_message(chat_id, message_id, text, buttons=None): Edit a previously sent message.
  • delete_message(chat_id, message_id): Delete a message.

For a full list of methods and examples, check out the Wiki.


🐛 Issues

Encountered a bug or need help? Report it here.


📜 License

This project is licensed under the CC-BY-SA 4.0. See the LICENSE for details.


🌟 Acknowledgments

Big thanks to the contributors of python-telegram-bot for the robust foundation, and to the developers and testers who helped shape PyRexBot.


📬 Contact


Happy Bot Building with PyRexBot! 🦖🤖

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

pyrexbot-1.0.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

PyRexBot-1.0.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pyrexbot-1.0.3.tar.gz.

File metadata

  • Download URL: pyrexbot-1.0.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for pyrexbot-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c9bc5cd404324bf3f7385bc348381aaf391b983f47f5a28f0eb94b7999806bbc
MD5 2152ff5c36bc00bc63df1460098154b0
BLAKE2b-256 25414aba26c763208b9550e48add076f8635a9625e10dbd2675e724faa47e0f9

See more details on using hashes here.

File details

Details for the file PyRexBot-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: PyRexBot-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for PyRexBot-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d2be39c85cfb578638e0e7d94e571166fbca17b2aea998c2a74109136240b03a
MD5 9f464474e5d2bb30e765c5522c512b7d
BLAKE2b-256 d9c7a472509d402413e32a30d74ba1766ba76ae8db0989d94480c800f0cd08b7

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