A simple and flexible Python library for building advanced Rubika bots with powerful message handling, inline buttons, and custom filters.
Project description
Rubigram
A lightweight Python library to build Rubika bots easily.
Installation
pip install RubigramClient
Send Message
from rubigram import Client, filters
from rubigram.models import Update
bot = Client("your_bot_token", "you_endpoint_url")
@bot.on_message(filters.command("start") & filters.private)
async def start_handler(client, message: Update):
await message.reply("Hi, WELCOME TO RUBIGRAM")
bot.run()
Send Message & Get receiveInlineMessage
from rubigram import Client, filters
from rubigram.models import Update, Button, Keypad, KeypadRow, InlineMessage
bot = Client(token="bot_token", endpoint="endpoint_url")
@bot.on_message(filters.command("start"))
async def start(_, message: Update):
inline = Keypad(
rows=[
KeypadRow(
buttons=[
Button("1", "Simple", "Button 1"),
Button("2", "Simple", "Button 2")
]
)
]
)
await bot.send_message(message.chat_id, "Hi", inline_keypad=inline)
@bot.on_inline_message(filters.button(["1", "2"]))
async def button(_, message: InlineMessage):
if message.aux_data.button_id == "1":
await bot.send_message(message.chat_id, "You Click Button 1")
elif message.aux_data.button_id == "2":
await bot.send_message(message.chat_id, "You Click Button 2")
bot.run()
Contex Manager
from rubigram import Client
import asyncio
bot = Client("bot_token")
async def main():
async with bot:
data = await bot.get_me()
print(data.bot_id)
asyncio.run(main())
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
rubigramclient-1.5.4.tar.gz
(9.6 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
File details
Details for the file rubigramclient-1.5.4.tar.gz.
File metadata
- Download URL: rubigramclient-1.5.4.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe7347f9ca7a4abea184b49146ebc99a09c14901cca60c189651304e8d21d4a5
|
|
| MD5 |
ec8d32b3c15379ecdb32c44fdc38d2cf
|
|
| BLAKE2b-256 |
3d0c3b90cfcddc74b9d9e2aae89e8716578aee8fc968563c3a8d98350b36d396
|
File details
Details for the file rubigramclient-1.5.4-py3-none-any.whl.
File metadata
- Download URL: rubigramclient-1.5.4-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d01c3f6b148cea8ad20945fe0e257da2fd28b239eadba67430ea68e97b16dc
|
|
| MD5 |
650495c5501400048b13cb88527b9a35
|
|
| BLAKE2b-256 |
b46060be33b9925975c80dad887c1dc21473631b42bb41a71cf255c1b28c6411
|