A universal multiplatform message bot
Project description
omniunibot
An omnipotent universal bot for python
- An omnipotent universal message bot library
Installation
- (via pip)
pip install -U omniunibot
- (via source) clone this repo &&
python setup.py install
orpython setup.py develop
Usage
Standalone non-blocking mode
-
Prepare a config file
- Default config path:
$HOME/configs/omniunibot.json
- Config example
{ "channels": { "test-channels": [ { "platform": "feishu", "webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx-xxxxx", "secret": "xxxxx" }, { "platform": "dingtalk", "webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxxxx", "secret": "SECxxxxx" }, { "platform": "wecom", "webhook": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxx-xxxxx" } ] }, "bind": "tcp://localhost:58655" }
- Default config path:
-
Start the bot server
python -m omniunibot --channel test-channels
-
Use the client-side code in your code
from omniunibot import OmniUniBotClient client = OmniUniBotClient("tcp://*:58655") client.send( title="msgTitle", msg="msgContent" )
Integration mode
# import bots
from omniunibot import FeishuBot, DingTalkBot, WeComBot
# initialize bots
bot = FeishuBot('<webhook_id>', '<secret>')
bot = DingTalkBot('<token>', '<secret>')
bot = WeComBot('<token>')
# send message
bot.sendQuickMessage('Test Passed')
You could check the code example in ./example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
omniunibot-0.0.2.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for omniunibot-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0ca41bea675795632a3342145b296eff8b5a3f28f172bd4ee29c37146bec557 |
|
MD5 | c32ebb9d8d009581df7edc82af3d1ac8 |
|
BLAKE2b-256 | 3521e04ba6e5944f284765618ae00217492d4e5b074ef715cbb9c5af435874ce |