Skip to main content

An advanced Python library for Bale messenger bots, inspired by Telegram Bot API

Project description

Baleh An advanced Python library for Bale messenger bots, inspired by Telegram Bot API.

Installation bash

کپی pip install baleh Features Send text messages, photos, videos, audio, stickers, and documents Manage chats (get chat info, ban/unban members) Handle incoming messages with decorators Asynchronous API with aiohttp Webhook support Type hints for better IDE support Usage Send a Message python

کپی from baleh import BaleClient import asyncio

async def main(): client = BaleClient("your_bot_token") await client.connect() message = await client.send_message(chat_id=123456789, text="Hello, Bale!") print(message.text) await client.disconnect()

asyncio.run(main()) Send a Photo python

کپی async def send_photo(): client = BaleClient("your_bot_token") await client.connect() message = await client.send_photo(chat_id=123456789, photo="path/to/photo.jpg", caption="My photo") await client.disconnect()

asyncio.run(send_photo()) Handle Incoming Messages python

کپی async def handle_messages(): client = BaleClient("your_bot_token")

@client.on_message()
async def on_message(message):
    await client.send_message(message.chat.id, f"Received: {message.text}")

await client.connect()
await client.start_polling()

asyncio.run(handle_messages()) Contributing Fork the repository at github.com/hamidrashidi98/baleh and submit pull requests.

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

baleh-0.2.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

baleh-0.2.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file baleh-0.2.2.tar.gz.

File metadata

  • Download URL: baleh-0.2.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for baleh-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d1bf8c74e0146faac447563ba8655e3f740c116f15d50742b4c717e9f1c091b0
MD5 8394dcada22feebed9b2e975559630dd
BLAKE2b-256 5cd76e07b6b33368e9e819cf7aea82fa18cce42458118f040361272d754e97f9

See more details on using hashes here.

File details

Details for the file baleh-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: baleh-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for baleh-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4395bfb29b90ca98f3ba591c18dfca5291043a101e2a2d5280b6e80efb16c20e
MD5 d31bcdf3820e59493170ade7fb0848f6
BLAKE2b-256 452c5381477cc705122d1de53db47df55238138af98be717d7b1f7ce03df83f5

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