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')
如果你的配置正确,那么消息应该就已经发送到你的钉钉群里了。
使用@功能
@指定人员需要向at_mobiles参数传入指定@人员的手机号列表,例如:
inform(webhook=webhook, secret=secret, title='My Title', text='My Text', at_mobiles=['15811112009', '15822222009'])
@所有人需要向at_all参数传入True,例如:
inform(webhook=webhook, secret=secret, title='My Title', text='My Text', at_all=True)
还可以同时使用@指定人和@所有人的功能,例如:
inform(webhook=webhook, secret=secret, title='My Title', text='My Text', at_mobiles=['15811112009', '15822222009'], at_all=True)
Metadata
Release files for pydingbot 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydingbot-0.0.3.tar.gz | 4.3 kB | Without provenance | Details for pydingbot-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydingbot-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pydingbot-0.0.3-py3-none-any.whl |
Total release size: 9.0 kB
Release files / pydingbot-0.0.3.tar.gz
| Download URL | pydingbot-0.0.3.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcd8a86c037a4123addb221f044252c0e7f46d92a897f4b737d1f66f9d1f4d17
|
|
BLAKE2b-256 checksum How to use checksums |
80f9706143294654052cd57e21b36523f6c66f7837bc71c11183077c6c94d1bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
|
Release files / pydingbot-0.0.3-py3-none-any.whl
| Download URL | pydingbot-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5610152832eb5b74754976296977c7e40c59cba5fc6fe228cc6d1fe0112bd629
|
|
BLAKE2b-256 checksum How to use checksums |
d935fcacb330557d55b585739b71768331008372ab70f95297447d7f84cbf4c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
|
Security for pydingbot 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.