https://github.com/mohamadkhoshnava/rocketchatbot
Python lib for create rocketchat bot with getupdate like TelegramBots
https://github.com/mohamadkhoshnava/rocketchatbot
rocketchat rocketchat-api rocketchat-bot rocketchat-sdk
Last synced: 3 months ago
JSON representation
Python lib for create rocketchat bot with getupdate like TelegramBots
- Host: GitHub
- URL: https://github.com/mohamadkhoshnava/rocketchatbot
- Owner: mohamadkhoshnava
- Created: 2022-10-31T11:11:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T23:17:56.000Z (over 2 years ago)
- Last Synced: 2026-01-14T09:30:16.563Z (5 months ago)
- Topics: rocketchat, rocketchat-api, rocketchat-bot, rocketchat-sdk
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RocketPyBot
## Python lib for create rocketchat bot with getupdate like TelegramBots
### This library is based on [rocketchat_API](https://github.com/jadolg/rocketchat_API)
### Installation
```bash
pip install pyrocketbot
```
### Usage
```python
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