Skip to main content

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


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.2b0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

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

rubxy-0.1.2b0-py3-none-any.whl (59.7 kB view details)

Uploaded Python 3

File details

Details for the file rubxy-0.1.2b0.tar.gz.

File metadata

  • Download URL: rubxy-0.1.2b0.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

Hashes for rubxy-0.1.2b0.tar.gz
Algorithm Hash digest
SHA256 8111e6d468492ac78d65d73d6ecfdfe8f99d789097bcee640143fa64021ebb39
MD5 e55a49d2e7421e6ffe9d91c08d62ecde
BLAKE2b-256 6d6bdd1e0dd34310d709f96c9b23753e79217487cdb446948b084fbaad1477d8

See more details on using hashes here.

File details

Details for the file rubxy-0.1.2b0-py3-none-any.whl.

File metadata

  • Download URL: rubxy-0.1.2b0-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

Hashes for rubxy-0.1.2b0-py3-none-any.whl
Algorithm Hash digest
SHA256 4566bc19ec84666af29cfa3d1b031d2bf95afdbb7db7d3db113f951cda5ad33a
MD5 85195076c3cc862a7d4c737f48fd9baa
BLAKE2b-256 46117eb8275cda83e6738adb1b71acb09ef04f35663fb619fc629149c6247a16

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