diff --git a/channel/wechatcom/README.md b/channel/wechatcom/README.md new file mode 100644 index 0000000..7e1d77a --- /dev/null +++ b/channel/wechatcom/README.md @@ -0,0 +1,33 @@ + +> 详细文档暂无 + +## 自建应用 + +- 在企业微信工作台自建应用 + +建立应用后点击通过API接收消息,设置服务器地址,服务器地址是`http://url:port/wxcomapp`的形式,也可以不用域名,比如 `http://ip:port/wxcomapp` + +- 修改配置 + +在主目录下的`config.json`中填写以下配置项 + +```python + # wechatcom的通用配置 + "wechatcom_corp_id": "", # 企业微信公司的corpID + # wechatcomapp的配置 + "wechatcomapp_token": "", # 企业微信app的token + "wechatcomapp_port": 9898, # 企业微信app的服务端口,不需要端口转发 + "wechatcomapp_secret": "", # 企业微信app的secret + "wechatcomapp_agent_id": "", # 企业微信app的agent_id + "wechatcomapp_aes_key": "", # 企业微信app的aes_key +``` + +- 运行程序 + +```python app.py``` + +在设置服务器页面点击保存 + +- 添加可信IP + +在自建应用管理页下方,将服务器的IP添加到可信IP diff --git a/channel/wechatcom/wechatcomapp_channel.py b/channel/wechatcom/wechatcomapp_channel.py index a791e41..0dad142 100644 --- a/channel/wechatcom/wechatcomapp_channel.py +++ b/channel/wechatcom/wechatcomapp_channel.py @@ -43,7 +43,7 @@ class WechatComAppChannel(ChatChannel): def startup(self): # start message listener - urls = ("/wxcom", "channel.wechatcom.wechatcomapp_channel.Query") + urls = ("/wxcomapp", "channel.wechatcom.wechatcomapp_channel.Query") app = web.application(urls, globals(), autoreload=False) port = conf().get("wechatcomapp_port", 8080) web.httpserver.runsimple(app.wsgifunc(), ("0.0.0.0", port))