A Python library for interacting with the Rubika bot API.
Project description
rubxy
rubxy is a Python library for interacting with the Rubika bot API.
It makes it easy to send and receive messages, handle events, and build bots quickly.
Features
- Send and receive messages via Rubika API
- Easy-to-use event handlers
- Fully asynchronous & Support sync
Installation
pip install rubxy
Async Usage
-
Messages Updates
from rubxy import Client, filters from rubxy.types import Update client = Client(bot_token="BOT_TOKEN") @client.on_message(filters.commands("start")) async def start_handler(client: Client, update: Update): await update.reply("Hello from rubxy") # Run in long-polling mode client.run() # Or run in webhook mode (recommended) client.run(endpoint="https://example.com")
-
Inline Updates
from rubxy import Client, filters from rubxy.types import InlineMessage client = Client(bot_token="BOT_TOKEN") @client.on_inline_message(filters.regex("^button-(\w+)")) async def inline_message_handler(client: Client, i: InlineMessage): await i.answer( text="you clicked button-id: {}".format( i.matches[0].group(1) ) ) # Run in long-polling mode client.run() # Or run in webhook mode (recommended) client.run(endpoint="https://example.com")
Sync Usage
-
Messages Updates
from rubxy import Client, filters from rubxy.types import Update client = Client(bot_token="BOT_TOKEN") @client.on_message(filters.commands("start")) def start_handler(client: Client, update: Update): update.reply("Hello from rubxy") # Run in long-polling mode client.run() # Or run in webhook mode (recommended) client.run(endpoint="https://example.com")
-
Inline Updates
from rubxy import Client, filters from rubxy.types import InlineMessage client = Client(bot_token="BOT_TOKEN") @client.on_inline_message(filters.regex("^button-(\w+)")) def inline_message_handler(client: Client, i: InlineMessage): i.answer( text="you clicked button-id: {}".format( i.matches[0].group(1) ) ) # Run in long-polling mode client.run() # Or run in webhook mode (recommended) client.run(endpoint="https://example.com")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rubxy-0.1.3b0.tar.gz
(35.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rubxy-0.1.3b0-py3-none-any.whl
(59.7 kB
view details)
File details
Details for the file rubxy-0.1.3b0.tar.gz.
File metadata
- Download URL: rubxy-0.1.3b0.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5683b0dfe5eda8a1d7de1dee8c688b4bb07809159533173429337ad2b65ac9fd
|
|
| MD5 |
f2120d3417d226294747d7dbe74541c4
|
|
| BLAKE2b-256 |
bbc49d96b948408f18d7992c3e7545acd06d1272756703bead33bca1fc4d5b10
|
File details
Details for the file rubxy-0.1.3b0-py3-none-any.whl.
File metadata
- Download URL: rubxy-0.1.3b0-py3-none-any.whl
- Upload date:
- Size: 59.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d41483265529321469f254481aee63c0a0b9788c17b9dbbd540161728ab3514
|
|
| MD5 |
e0e53cbc034cf64ed560f468aec008d3
|
|
| BLAKE2b-256 |
4b7c7f2d37c3054de4f4c621f859e5b1f844bdf03d32a45ecc5d13146b456f4f
|