A package to make dingbot easily to use
Project description
pydingbot
pydingbot 是一个让钉钉机器人更好用的包。
安装
你可以用 pip
来安装pydingbot
$ pip install pydingbot
使用
在使用pydingbot之前,首先你需要在钉钉群里添加你的机器人,安全设置选择加签,然后点开“机器人设置”找到 webhook 和 secret(秘钥),这些是使用机器人所必须的信息,webhook和secret的来源如图所示:
使用示例:
>>> from pydingbot import inform
>>> webhook = 'https://oapi.dingtalk.com/robot/send?access_token=170d919d864e90502b48603ecbcd7646701bd66cc590f495bac1b7c5049e171e'
>>> secret = 'SEC474937571de1506cdd724af0d5866f4fa2788968032a2d6d982da988bea4e5de'
>>> inform(webhook=webhook, secret=secret, title='My Title', text='My Text')
>>> inform(webhook=webhook, secret=secret, title='My Title', text='My Text', at_mobiles['158xxxx2009'], at_all=True)
如果你的配置正确,那么消息应该就已经发送到你的钉钉群里了。
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
pydingbot-0.0.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for pydingbot-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e6caa3be06c95e53254397b8997eb83b19e378a24523aeb04ffddc250c6c9b |
|
MD5 | eb3e116e4cb379aaf907b4406d2d259d |
|
BLAKE2b-256 | 9789bb1029918d3b56ad69d60df9d1f02caf63f1026b10a70fb31dbbce7a0ec1 |