Wecom(A.K.A. WeChat Work) Group Bot python API.
Project description
pywgb
Wecom(A.K.A. WeChat Work) Group Bot python API.
Homepage
ChowRex/pywgb: Wecom(A.K.A Wechat Work) Group Bot python API.
How to use
-
Create a Wecom Group Bot.
-
Copy the webhook URL or just the
key. It should be like:Webhook: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=UUIDKey: UUID
-
Install this package:
pip install -U pywgb
-
Refer code below:
from pywgb import TextWeComGroupBot, MarkdownWeComGroupBot, ImageWeComGroupBot, NewsWeComGroupBot, FileWeComGroupBot KEY = "PASTE_YOUR_KEY_OR_WEBHOOKURL_HERE" # If you want to send Text message, use this. msg = "This is a test Text message." bot = TextWeComGroupBot(KEY) bot.send(msg) # If you want to send Markdown message, use this. msg = "# This is a test Markdown title message." bot = MarkdownWeComGroupBot(KEY) bot.send(msg) # If you want to send Image message, use this. file = "Path/To/Your/Image.png" or "Path/To/Your/Image.jpg" bot = ImageWeComGroupBot(KEY) bot.send(file_path=file) # If you want to send News message, use this. articles = [ { "title": "This is a test news", "description": "You can add description here", "url": # Here is the link of picture "www.tencent.com", "picurl": "https://www.tencent.com/img/index/tencent_logo.png" }, ] bot = NewsWeComGroupBot(KEY) bot.send(articles=articles) # If you want to send File message, use this. file = "Path/To/Your/File.suffix" bot = FileWeComGroupBot(KEY) bot.send(file_path=file)
Official Docs
Only Chinese version doc: 群机器人配置说明 - 文档 - 企业微信开发者中心
Roadmap
-
v0.0.1: 🎉 Initial project. Offering send Text and Markdown type message.
-
v0.0.2: 🖼️ Add
Imagetype message support;Add overheat detect function and unified exception handling
-
v0.0.3: 📰 Add
Newstype message support;Move bots into a new module:
bot -
v0.0.4: 📂 Add
Filetype message support;Refactor
botmodule -
v0.0.5: 🗣️ Add
Voicetype message support. -
v0.0.6: 🗒️ Add
TextCardtype message support. -
v0.0.7: 🗃️ Add
PictureCardtype message support. -
v0.1.0: 👍 First FULL capacity stable version release.Fix bugs and so on.
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
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 pywgb-0.0.4.tar.gz.
File metadata
- Download URL: pywgb-0.0.4.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdeb62677b520a40fef0e6c9a6202c6edd89e23a669c7d3bc172be77833257da
|
|
| MD5 |
cf6f616d6b0c796856b8caf242887e14
|
|
| BLAKE2b-256 |
d6facd21e7c398ff712d680d01705a787cb60991d95c3209441c309f2d90795b
|
File details
Details for the file pywgb-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pywgb-0.0.4-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2147ec5a6724b80bb2d31ee0ca9b470f3a3f9eeca6462a25bdf45613362a8d0
|
|
| MD5 |
898523dc49e1c8613d383d74e7ec1443
|
|
| BLAKE2b-256 |
0e1c990f8685799a50ac4b10d7faaf17235214bbedf2ce77adf35df589774cbc
|