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.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


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.5.tar.gz (9.6 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.5.5-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rubigramclient-1.5.5.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

Hashes for rubigramclient-1.5.5.tar.gz
Algorithm Hash digest
SHA256 7c5bad2a1baa4f088d3c38b43fd4c35dad49e85157bd9ebdd41e9e18f3bc69b9
MD5 c5f86cc0c6a759b99a05d00bff67f9c9
BLAKE2b-256 d303d1f93b1939d6e387e796290f0bcd335be8efa3566febbaebb5c2e8e4453a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rubigramclient-1.5.5-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

Hashes for rubigramclient-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4f358232e3e1b6b534be31a4f0b96b3121e00acb373b98ac02ef102c27aa50a5
MD5 2baf669ca6105f24a94e0989d0250ef0
BLAKE2b-256 c075b72e1c4653c922004e2bfe715e5c52c03068581978cbcd958488bcfd0825

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