Skip to main content

RocketPyBot

Python lib for create rocketchat bot with getupdate like TelegramBots

Installation

pip install rocketpybot

Usage

import os
from rocketpybot import RocketBot

username = os.environ.get('ROCKET_USERNAME')
password = os.environ.get('ROCKET_PASSWORD')
server_url = os.environ.get('ROCKET_SERVER_URL')

proxy_dict = {
    "http"  : "http://127.0.0.1:2080",
    "https" : "https://127.0.0.1:2080",
}

bot = RocketBot(username, password, server_url)
# bot = RocketBot(username, password, server_url, proxy_dict=proxy_dict)


@bot.command(r'/start')
def start(message, match_list):
    bot.send_message(message['rid'], 'hi')

@bot.command(r'/echo (.*)')
def echo(message, match_list):
    bot.send_message(message['rid'], match_list[0])


if __name__ == '__main__':
    print('Bot started')
    bot.run(chat_type='d', sleep=0.5)

Note :

in run method you can set chat_type to 'd' for direct message or 'c' for channel message and set sleep for sleep time per update

Metadata

Release files for rocketbotlib 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rocketbotlib 0.0.1
File Interpreter ABI Platform
rocketbotlib-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / rocketbotlib-0.0.1-py3-none-any.whl

Download URL rocketbotlib-0.0.1-py3-none-any.whl
Size 2.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b94771797b23ab3dd615cbd2841097dce9726ae85132f3588378d4d6e793178b
BLAKE2b-256 checksum
How to use checksums
2b24f3d8221471f0df46a229f8c9d5e46d6d1cb8197f2f0b0f0bf1cb80787199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page