wecom-notify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WeCom Notify

企业微信通知

Send text, image, or file messages to WeCom (企业微信) using
scripts/send_wecom.py
.
使用
scripts/send_wecom.py
脚本向企业微信发送文本、图片或文件消息。

Usage

使用方法

bash
undefined
bash
undefined

Text message

文本消息

python3 scripts/send_wecom.py "消息内容" python3 scripts/send_wecom.py "消息内容" --to LiXueHeng
python3 scripts/send_wecom.py "消息内容" python3 scripts/send_wecom.py "消息内容" --to LiXueHeng

Image message

图片消息

python3 scripts/send_wecom.py --image /path/to/photo.png python3 scripts/send_wecom.py --image /path/to/chart.jpg --to @all
python3 scripts/send_wecom.py --image /path/to/photo.png python3 scripts/send_wecom.py --image /path/to/chart.jpg --to @all

File message

文件消息

python3 scripts/send_wecom.py --file /path/to/report.pdf python3 scripts/send_wecom.py --file /path/to/data.xlsx --to LiXueHeng

Default recipient: `LiXueHeng`. Config is read from `~/.openclaw/openclaw.json` (env.vars section).
python3 scripts/send_wecom.py --file /path/to/report.pdf python3 scripts/send_wecom.py --file /path/to/data.xlsx --to LiXueHeng

默认接收人:`LiXueHeng`。配置信息从`~/.openclaw/openclaw.json`文件的env.vars章节读取。

Notes

注意事项

  • Requires proxy (
    WECOM_PROXY
    in config) — API calls route through Guangzhou VPS tinyproxy at
    10.147.17.105:8888
    via ZeroTier
  • WeCom text messages have a 2048-byte limit (~680 Chinese characters). For longer messages, split into multiple sends
  • Image upload supports: jpg, png, gif (max 2MB for image type)
  • File upload supports: any format (max 20MB)
  • Uploaded media is temporary (3 days validity on WeCom servers)
  • The script uses only Python stdlib (
    urllib.request
    ,
    json
    ,
    mimetypes
    ,
    uuid
    ) — no pip dependencies
  • 需要代理(配置文件中的
    WECOM_PROXY
    )——API请求通过ZeroTier路由至广州VPS上的tinyproxy,地址为
    10.147.17.105:8888
  • 企业微信文本消息有2048字节限制(约680个中文字符)。若消息过长,请拆分多次发送
  • 图片上传支持格式:jpg、png、gif(图片类型最大2MB)
  • 文件上传支持任意格式(最大20MB)
  • 上传的媒体文件为临时文件(在企业微信服务器上的有效期为3天)
  • 该脚本仅使用Python标准库(
    urllib.request
    json
    mimetypes
    uuid
    )——无需通过pip安装依赖