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(token="YOUR_TOKEN_BOT")

@bot.on_message(filters.private)
async def welcome_message(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", "Button 1"),
                    Button("2", "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("YOUR_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.6.6.tar.gz (9.4 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.6.6-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rubigramclient-1.6.6.tar.gz
Algorithm Hash digest
SHA256 16d9605b56b1c95d6ef7e2ce7ed79a8c666e14292c2a65af87e3e2ada52044dc
MD5 108b59ab38ba5186944a11b69ad33866
BLAKE2b-256 a6022ea6663319570e077e191c85396e8663b77947d395fdbe18e6bc8955f493

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rubigramclient-1.6.6-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9eea0927e146bdc4ef4c2cda54fc083b4f65115561f1e64acf8ba3c9ac38b0f5
MD5 fa7c8134a0825640dc6dd5a0c69a0e83
BLAKE2b-256 94449537aa8d79ddd708f1022f1e3c1a82a46f7a05c4a168aec59814f1c94792

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