Registry / communication / wecom-aibot-python-sdk

wecom-aibot-python-sdk

JSON →
library1.0.2pypypi✓ verified 82d ago

企业微信智能机器人 Python SDK,基于 WebSocket 长连接通道,提供消息收发、流式回复、模板卡片、事件回调、文件下载解密等核心能力。当前版本 1.0.2,要求 Python >=3.8。

pip install wecom-aibot-python-sdk
INSTALL
IMPORT
SIG · WECOM-AIBOT-PYTHON
W
wecom-aibot-python-sdk
communicationpythonv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WeComApiClient
from aibot import WeComApiClient
from wecom_aibot import WeComBot

初始化机器人并注册消息监听,运行 WebSocket 连接。

import os from wecom_aibot import WeComBot bot = WeComBot( app_id=os.environ.get('WECOM_APP_ID', ''), app_secret=os.environ.get('WECOM_APP_SECRET', ''), token=os.environ.get('WECOM_TOKEN', ''), encoding_aes_key=os.environ.get('WECOM_ENCODING_AES_KEY', '') ) @bot.on_message() def echo(msg): return msg.reply_text('Hello from WeCom Bot!') bot.run()
Debug
Known issues
breakingv1.0.0 至 v1.0.2 之间回调注册方式变更,旧版使用 @bot.on_text 现已改为 @bot.on_message()。
fix
升级后使用 @bot.on_message() 替代 @bot.on_text 
affects: <1.0.0
gotchatoken 和 encoding_aes_key 需从企业微信后台获取,如果填错会导致连接失败且无明确错误提示。
fix
请确保在企微后台的『机器人』配置中复制正确的 Token 和 EncodingAESKey。
affects: all
deprecated旧版导入路径 from wecom_aibot_python_sdk import ... 在 v1.0.0 后不再支持。
fix
改为 from wecom_aibot import ...
affects: <1.0.0
Upgrade
Version history
1.0.2latest on PyPI · released Mar 23, 2026
Audit
Dependencies
websocketsrequiredWebSocket 长连接依赖
cryptographyrequired消息加解密和文件解密
Agent activity
44 hits · last 30 days
node
40
OpenAI (training)
1
Resources
wecom-aibot-python-sdk — pip install wecom-aibot-python-sdk · libregistry