Skip to main content

A bot for rocketchat messaging, allowing you to react to messages or commands.

Project description

Rocketbotte

A bot for rocketchat messaging, allowing you to react to messages or commands.

It works with rocketchat's realtime api (websocket) to receive messages, and responds with the REST api. To do this, it uses the aiohttp python library.

Installation

pip install rocketbotte

Usage

from rocketbotte import Bot, Context, Message

bot = Bot(server_url=SERVER_URL, user_id=USER_ID, auth_token=AUTH_TOKEN)

@bot.command('test')
async def test(ctx:Context, args:str):
    await ctx.send_message(f'response to {args}')

@bot.listen()
async def on_message(message:Message):
    if 'hello' in message.content:
        await bot.send_message(message.room_id, 'world ')

bot.run()

Bot parameters

  • server_url: the server url as https://myrocketchat.org
  • auth_token: the personal authentification token for the bot
  • command_prefix: default : '!'
  • user_id: the user id who belongs to the authentification token
  • max_retry: number of attempt restart after an uncaught exception, default to 5

logging

This library use loguru for logging. To see logs explicit ask for by using logger.enable("rocketbotte")

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

rocketbotte-0.2.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

rocketbotte-0.2.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file rocketbotte-0.2.1.tar.gz.

File metadata

  • Download URL: rocketbotte-0.2.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for rocketbotte-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4c06511fc3d67647e02375d660f433262f91ef5ea34555c9daf023c1d89b7ac7
MD5 cb3cd75a19a17bccf7866ff466e145b3
BLAKE2b-256 cf02feb57298f4f776a404c59fff629be4b550ec95913de2566288d24368d279

See more details on using hashes here.

File details

Details for the file rocketbotte-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: rocketbotte-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for rocketbotte-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f6eb4884a71f3d31ef11720f83c67a923858fa926dedec604ea3c98681f0249
MD5 b648a1717d6c9cd5596380532619779e
BLAKE2b-256 da36117a0e9b961940b4a5fdccfacc7087a33d82b46b692f88e8ca548096f1c6

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