Skip to main content

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.types import Update

bot = Client("your_bot_token", "you_endpoint_url")

@bot.on_message(filters.command("start"))
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.types 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()

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

rubigramclient-1.4.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

rubigramclient-1.4.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file rubigramclient-1.4.1.tar.gz.

File metadata

  • Download URL: rubigramclient-1.4.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for rubigramclient-1.4.1.tar.gz
Algorithm Hash digest
SHA256 9699f972097c2c0d5210787b64a8bae4e0339ca5b099a5daed26f849fb56a6e0
MD5 22a9d2293696f11a3aab0ef5e4be4192
BLAKE2b-256 5f653dd1ee84c3b097098ba631d7e200398f9354c3e5a3332181ce72110fbde7

See more details on using hashes here.

File details

Details for the file rubigramclient-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: rubigramclient-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for rubigramclient-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a3eec892520aeb5dd0814ceab5e5f878a2581095929e67f68fab1cdc12e6404
MD5 4b363da011b783bc4bbf351b70ae7f1b
BLAKE2b-256 1c677a599f71b89c62c8fbda1a1ae6e83d86174388f5aae584eed6eb082c1347

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