{"id":19296971,"url":"https://github.com/biubush/wechatworkbot","last_synced_at":"2026-02-13T13:04:22.205Z","repository":{"id":261754143,"uuid":"885239484","full_name":"Biubush/WechatWorkBot","owner":"Biubush","description":"简易轻量的企业微信对话机器人框架","archived":false,"fork":false,"pushed_at":"2024-11-08T08:31:40.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T00:44:11.303Z","etag":null,"topics":["agent","bot","chatbot","flask","wechat","wechat-work","wecom"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Biubush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T08:16:19.000Z","updated_at":"2024-12-02T17:01:21.000Z","dependencies_parsed_at":"2024-11-08T09:18:30.572Z","dependency_job_id":"d7aa4f13-c0bb-4e51-9bdc-b3e4cbd16db9","html_url":"https://github.com/Biubush/WechatWorkBot","commit_stats":null,"previous_names":["biubush/wechatworkbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biubush%2FWechatWorkBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biubush%2FWechatWorkBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biubush%2FWechatWorkBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biubush%2FWechatWorkBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Biubush","download_url":"https://codeload.github.com/Biubush/WechatWorkBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240400291,"owners_count":19795331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","bot","chatbot","flask","wechat","wechat-work","wecom"],"created_at":"2024-11-09T23:01:03.665Z","updated_at":"2026-02-13T13:04:22.166Z","avatar_url":"https://github.com/Biubush.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 简介\n\n一个简易的企业微信机器人框架\n\n用于构建一个可以进行对话交互的企业微信机器人\n\n特性：\n\n- 正则匹配和关键词匹配，两种方式进行消息识别，精准回复消息\n- 会话日志输出，运行过程中的机器人对话全程记录\n- 简单的参数配置即可运行，轻量便携\n\n# 使用说明\n\n## 配置环境\n\n命令行下执行以下指令\n\n```shell\ngit clone https://github.com/Biubush/WechatWorkBot.git # 拉取仓库到本地\ncd WechatWorkBot # 进入文件夹\npip install -r requirements.txt # 安装依赖库\n```\n\n## 配置参数\n\n### CORP_ID获取\n\n首先打开[企业微信](https://work.weixin.qq.com/wework_admin/frame)，点击导航栏的**我的企业**\n\n然后将页面最底端的**企业ID**复制下来，粘贴到项目文件夹下的**config.py**中的**CORP_ID**中（记得有英文双引号）\n\n### AGENT_ID和CORP_SECRET获取\n\n在[企业微信](https://work.weixin.qq.com/wework_admin/frame)导航栏的**应用管理**中在**自建**板块点击**创建应用**\n\n配置完毕进入应用管理页面后，将**AgentId**复制粘贴到项目文件夹下的**config.py**中的**AGENT_ID**中（记得有英文双引号）\n\n点击**Secret**下的查看，去手机上的企业微信中查看Secret，复制粘贴到项目文件夹下的**config.py**中的**CORP_SECRET**中（记得有英文双引号）\n\n### TOKEN和ENCODING_AES_KEY获取\n\n在上一步打开的应用管理页面中，找到功能-接收消息-设置API接收\n\n\u003e 注意，以下为重点步骤\n\n输入URL内容应为http://\u003c你的公网ip\u003e:44722/api/wechat\n\n如果你部署了域名，请根据实际情况进行更改\n\n然后，在该页面自定义或随机生成Token和EncodingAESKey，分别复制粘贴到项目文件夹下的**config.py**中的**TOKEN**和**ENCODING_AES_KEY**中（记得有英文双引号）\n\n注意，保持这个网页页面不要操作，后续运行起服务再进行下一步\n\n### 额外参数\n\n有以下额外参数可以添加进项目文件夹下的**config.py**中，但这些是非必要的\n\n- WORK_DIR # 工作文件夹，日志依赖此参数生成\n- SECRET_KEY # flask的秘钥对，有需要可以自行定义\n- DEBUG # flask是否以debug模式运行，布尔值，填Ture或False\n- PORT # 项目运行端口，整型\n\n## 配置对话规则\n\n编辑**WechatWorkBot\\msg_handler.py**，有两种匹配对话的方式\n\n1. 正则匹配\n\n2. 关键词匹配\n\n正则匹配使用@re_method装饰器，传入一个正则表达式，当用户发送的消息匹配该正则表达式时，将调用该函数处理消息\n\n关键词匹配使用@contain_method装饰器，传入一个字符串，当用户发送的消息包含该字符串时，将调用该函数处理消息\n\n## 运行项目\n\n执行以下命令\n\n```\npython run.py\n```\n\n即可运行起项目\n\n此时在**API接收消息**的页面点击**保存**，稍作等待即可配置完成\n\n再返回你的应用配置页面，找到**开发者接口**-**企业可信IP**-**配置**，将你的服务器ip填入并保存\n\n至此，你的项目理论上可以正常运行\n\n# 报错说明\n\n在运行过程中有报错时，请按照程序给你的指示进行排查和修复","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiubush%2Fwechatworkbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiubush%2Fwechatworkbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiubush%2Fwechatworkbot/lists"}