RocketPyBot
Python lib for create rocketchat bot with getupdate like TelegramBots
This library is based on rocketchat_API
Installation
pip install pyrocketbot
Usage
import os
from pyrocketbot 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 pyrocketbot 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrocketbot-1.0.5.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrocketbot-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.7 kB
Release files / pyrocketbot-1.0.5.tar.gz
| Download URL | pyrocketbot-1.0.5.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60f2613fbee457bdd99c4f7433c1d91ae1475e4b83fd62714955da942d0edce3
|
|
BLAKE2b-256 checksum How to use checksums |
a54ff999a14ce26585309ba81ba0fec881ee2ee0042c220fbf9859b78327cd7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|
Release files / pyrocketbot-1.0.5-py3-none-any.whl
| Download URL | pyrocketbot-1.0.5-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41e67925d225765793557c90fb9d703ac0f9d6c250ecec99449b1a25aa789d61
|
|
BLAKE2b-256 checksum How to use checksums |
4cbd4ff75e4a6963f08523eeae70a04ea913adef7cca5338258aabb716b89451
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|