Bale Bot API Python Library
A modern, easy-to-use Python wrapper for the Bale Bot API that makes building Bale bots simple and intuitive.
Features
- 🚀 Simple & Intuitive - Clean, Pythonic API design
- 📨 Full Message Support - Text, photos, videos, documents, and more
- ⌨️ Interactive Elements - Inline keyboards, reply keyboards, and buttons
- 🔄 Real-time Updates - Webhook and polling support
- 📁 File Handling - Easy upload and download of media files
- 🛡️ Error Handling - Comprehensive exception handling
- 📖 Type Hints - Full typing support for better development experience nc Support** - synchro
Installation
pip install pyrobale
Quick Start
from pyrobale.client import Client
from pyrobale.objects import Message, UpdatesTypes
bot = Client("YOUR_BOT_TOKEN")
@bot.on_message()
async def message_handler(message: Message):
await message.reply("Hello, world!")
bot.run()
Examples
Conversation Bot
from pyrobale.objects import *
from pyrobale.client import Client, Message, UpdatesTypes
client = Client("YOUR_BOT_TOKEN")
async def handle_message(message: Message):
if message.text == "/start":
await message.reply("Hi! Im a pyrobale RoBot!")
await client.wait_for(UpdatesTypes.MESSAGE)
await message.reply("Okay! wait_for Test Compeleted")
client.add_handler(UpdatesTypes.MESSAGE, handle_message)
client.run()
Echo Bot
from pyrobale.client import Client
from pyrobale.objects import Message, UpdatesTypes
bot = Client("YOUR_BOT_TOKEN")
@bot.on_message()
async def message_handler(message: Message):
await message.reply(message.text)
bot.run()
Echo Bot (sync)
You can also use sync handlers! We handle it automatically
from pyrobale.client import Client
from pyrobale.objects import Message, UpdatesTypes
bot = Client("YOUR_BOT_TOKEN")
@bot.on_message()
def message_handler(message: Message):
message.reply(message.text)
bot.run()
Inline Keyboard
from pyrobale.client import Client
from pyrobale.objects import Message, UpdatesTypes, InlineKeyboardButton, InlineKeyboardMarkup, CopyTextButton
bot = Client("YOUR_BOT_TOKEN")
async def message_handler(message: Message):
buttons = InlineKeyboardMarkup()
buttons.add_button("URL", url="https://pyrobale.ir")
buttons.add_button("Callback", callback_data="callback")
buttons.add_row()
buttons.add_button("WebApp", web_app="https://pyrobale.ir")
buttons.add_button("Copy", copy_text_button=CopyTextButton("TEXT"))
await message.reply("Hello, world!", reply_markup=buttons)
Core Abilities
- Message Handling - Process text, commands, and media messages
- Callback Queries - Handle inline keyboard interactions
- File Operations - Send and receive photos, videos, documents
- Chat Management - Get chat info, member management
- Custom Keyboards - Create interactive user interfaces
- Webhook Support - Production-ready webhook handling
- Middleware Support - Add custom processing layers
Documentation
For detailed documentation and advanced usage, visit our documentation site.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Metadata
Release files for pyrobale 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrobale-0.7.0.tar.gz | 80.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrobale-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 133.7 kB
Release files / pyrobale-0.7.0.tar.gz
| Download URL | pyrobale-0.7.0.tar.gz |
|---|---|
| Size | 80.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc1a1d8f08df426e3dd8a16ba64e265ac037f07917036aee1a6d4ced35c7d029
|
|
BLAKE2b-256 checksum How to use checksums |
f7db05a3e3b5b703ae63b9402b700bd79208d8ed5f163282dc5a8fe3b4a3fa94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / pyrobale-0.7.0-py3-none-any.whl
| Download URL | pyrobale-0.7.0-py3-none-any.whl |
|---|---|
| Size | 52.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7177710eb5e639c7c77966fbb1e48033fa53b9faa424acfab7be21806cd5592
|
|
BLAKE2b-256 checksum How to use checksums |
3cebcaec13f8083f133bc8579b0c4dc0ecc5807ca75d1d66f7be41372af8f3d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|