This is a msg-robot for work wechat.
Project description
WeixinWork
This is a msg-robot for WeixinWork
Install
python -m pip install WeixinWork
Getting Started
send text msg
import weixinwork
key = "b8cxxx"
bot = weixinwork.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 weixinwork issues
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file WeixinWork-0.1.0-py3-none-any.whl.
File metadata
- Download URL: WeixinWork-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d3c46ab76ed89e86acf8f0bd2220387d0dff18311e9eff0074326de538aaa93
|
|
| MD5 |
2907b79a9d6b31c5cabdecfabfa35836
|
|
| BLAKE2b-256 |
10ad45e919d6890d34da614f04de7716e23d8e8f3b60f8ac2bd2b6cf6f61a332
|