WecomBot
This is a msg-robot for Wecom
Install
python -m pip install WecomBot
Getting Started
send text msg
import wecombot
key = "b8cxxx"
bot = wecombot.Bot(key)
data = {
"msgtype": "text",
"text": {
"content": "hello world"
}
}
# @ user, all user
# data = {
# "msgtype": "text",
# "text": {
# "content": "LiuKeTest Msg",
# "mentioned_list":["liuke","@all"],
# "mentioned_mobile_list":["13800001111","@all"]
# }
#}
bot.send_msg(data)
send markdown msg
data = {
"msgtype": "markdown",
"markdown": {
"content": "实时新增用户反馈<font color=\"warning\">132例</font>,请相关同事注意。\n
>类型:<font color=\"comment\">用户反馈</font>
>普通用户反馈:<font color=\"comment\">117例</font>
>VIP用户反馈:<font color=\"comment\">15例</font>"
}
}
send image
bot.img_msg("path/test.jpg")
send file
media_id = bot.upload_file("path/liuke.zip")
data = {
"msgtype": "file",
"file": {
"media_id": media_id
}
}
bot.send_msg(data)
send image & text msg
data = {
"msgtype": "news",
"news": {
"articles" : [
{
"title" : "LiuKeTest",
"description" : "qywechat",
"url" : "https://xxx",
"picurl" : "http://xxx.png"
}
]
}
}
bot.send_msg(data)
Features
- Support all types message
- Support send image
- Support upload file
Contributing
Contributions are welcome.
If you've found a bug within this project, please open an issue to discuss what you would like to change.
If it's an issue with the API, please report any new issues at wecombot issues
Metadata
Release files for WecomBot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| WecomBot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for WecomBot-0.1.0-py3-none-any.whl |
Release files / WecomBot-0.1.0-py3-none-any.whl
| Download URL | WecomBot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
943a903734c8907f714d9b784fe7ea0aa8e36da13e3d8884da22c4ba704ef27b
|
|
BLAKE2b-256 checksum How to use checksums |
1363af1368f69dc8c60183f55a89022e2b7d2fbb7eee95f2428e3035d22da5a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
|
Security for WecomBot 0.1.0
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.