{"id":18652917,"url":"https://github.com/s045pd/webot","last_synced_at":"2025-08-10T22:43:42.887Z","repository":{"id":43248005,"uuid":"186563313","full_name":"s045pd/Webot","owner":"s045pd","description":"💪🤖️write a bot for wechat !","archived":false,"fork":false,"pushed_at":"2025-02-16T03:58:53.000Z","size":8115,"stargazers_count":12,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T20:03:58.683Z","etag":null,"topics":["bot","webapi","wechat","weixin"],"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/s045pd.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,"zenodo":null}},"created_at":"2019-05-14T06:57:20.000Z","updated_at":"2024-07-26T14:19:51.000Z","dependencies_parsed_at":"2025-04-11T16:31:56.629Z","dependency_job_id":"eb7af515-46c6-444b-bf4d-41471f45dc86","html_url":"https://github.com/s045pd/Webot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/s045pd/Webot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s045pd%2FWebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s045pd%2FWebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s045pd%2FWebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s045pd%2FWebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s045pd","download_url":"https://codeload.github.com/s045pd/Webot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s045pd%2FWebot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269799505,"owners_count":24477643,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bot","webapi","wechat","weixin"],"created_at":"2024-11-07T07:09:22.296Z","updated_at":"2025-08-10T22:43:42.838Z","avatar_url":"https://github.com/s045pd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"media/webot.png\" width=80 height=80 /\u003e\n    \u003ch1 align=\"center\" \u003eWebot\u003c/h1\u003e\n    \u003cp align=\"center\"\u003e这是一个基于web微信协议的简易微信机器人，目前功能比较简陋且不堪🙈。\u003c/p\u003e\n        \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.codacy.com/manual/aoii103/Webot?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=aoii103/Webot\u0026amp;utm_campaign=Badge_Grade\"\u003e\u003cimg src=\"https://api.codacy.com/project/badge/Grade/cb6b7e771f5b4cf8a2f7d65aa42a32bf\"/\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"https://www.python.org/downloads/\" title=\"Python version\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-%3E=_3.10-green.svg\"\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"LICENSE\" title=\"License: MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"Wechat\" title=\"Wechat\"\u003e\u003cimg src=\"https://img.shields.io/badge/power_by-Wechat-Green.svg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n## 现有功能\n\n- AI机器人（ollama）\n- 简单文字消息回复\n- 消息过滤\n- 实时信息展示(带斗图表情(Iterm2))\n- 语音消息自动播报及保存\n- 通讯录导出\n- 好友地区分布旭日图导出\n- 好友头像墙制作\n\n## 文件夹结构\n\n- ```extra``` \n  - ```analysis``` 分析整合结果文件夹\n    - ```x_contacts.xlsx``` 通讯录\n    - ```x_icon_wall.png``` 头像墙\n    - ```x_sunburst_city.html``` 区域分布旭日图\n  - ```log``` 聊天记录[未做]\n  - ```media``` 媒体文件夹\n    - ```emoji``` 聊天表情\n    - ```icons``` 好友头像\n    - ```images``` 聊天图片\n    - ```videos``` 聊天视频[未做]\n    - ```voices``` 聊天语音\n  - ```static```\n    - ```⚡️current_msg.json``` 最新消息日志[用于调试]\n    - ```batch_contacts.json``` 群聊数据\n    - ```contact.json``` 通讯录数据\n    - ```person_data.json``` 个人数据\n    - ```wxbot.pkl``` 缓存登录信息\n\n\n## 逻辑图\n\n\u003e `【varb】` 指代变量名 ，逻辑图内均使用python代码\n\n### 指示线\n\n![](./media/logic.png)\n\n### 登录逻辑图\n\n\n![](./media/webot_login.png)\n\n[mindnode文件](./media/webot_login.mindnode)\n\n## 环境安装\n\n首先保证您已经安装了```python3.10```及以上版本,然后依次运行如下命令。\n\n```sh\ngit clone https://github.com/aoii103/Webot.git\n\ncd webot\n\npython3 -m pip install -r requirements.txt\n```\n\n## 额外配置 \n\n在安装好依赖之后,我们在通过```webot/conf.py```该文件进行默认配置修改, 也可以通过```run```方法传入, 各参数作用如下。\n\n- ```debug = True```  开启debug模式\n- ```play_voice = True```  自动播报声音\n- ```export_xlsx = True```  自动导出好友列表\n- ```make_icon_wall = True``` 自动导出头像墙\n- ```sunburst_city = True``` 自动导出好友分布旭日图\n- ```need_interaction = False```  交互式shell\n\n## 案例用法\n下面是一个简单的文本回复案例即```test.py```\n\n```python\nfrom webot.core import Webot\nfrom webot.util import Device\nfrom pprint import pprint\n\n\nclass bot(Webot):\n    @Device.filters([\"text\"], is_me=True)\n    def send_back(self, msg):\n        pprint(msg)\n        if msg[\"type\"] == \"text\":\n            if \"你好\" == msg[\"content\"]:\n                self.send_text(msg[\"from\"], \"你好呀！\")\n\n\nbot().run(True, False)\n```\n\n当然我们也可以通过```python3 test.py```直接使用默认测试案例。\n\n以下是运行开始的截图!\n\n![](./media/demo.png)\n\n## 功能详解\n\n### 1.消息格式\n\n-  `from`为发送者ID\n-  `to`为接受者ID\n\n```python\n{\n\t\"content\": \"你好\",\n\t\"from\": \"@1798bad2f5dc126a19450ef2c86aa8e3\",\n \t\"from_nick\": \"zhangsan\",\n\t\"is_group\": False,\n\t\"is_me\": True,\n\t\"raw_content\": \"你好\",\n\t\"time\": 1560230438,\n\t\"to\": \"@8ef49591902e6c6642732eb7289a5619456u98965f6ea32fa671fe3ab33a002f\",\n\t\"to_nick\": \"filehelper\",\n\t\"type\": \"text\"\n}\n\n```\n### 2.通讯录导出结果\n\n所有的好友、公众号信息都会被保存至```xxx_contacts.xlsx```中。\n\n![](./media/xlsx.png)\n\n\n### 3.语音消息及播报\n\n语音流将会按照被下载存储,并通过pygame播放,但不知为何播放的声音仿佛过了变声器一般。\n\n![](./media/voice.png)\n\n### 4.机器人预设回复及表情\n\n![](./media/robot.png)\n\n### 5. 头像墙\n\n![](./media/icon_wall.jpg)\n\n### 6. 区域分布旭日图\n\n![](./media/sunburst_city.gif)\n\n\n## TODO\n\n- 文件及图片发送\n- 其他更多思考中的功能\n- 基于sqlite的消息记录\n\n## 📝 License\n\nThis project is [MIT](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE) licensed.\n\n***\n\n如果您觉得这个脚本对您有用，可别忘了star哟🐶。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs045pd%2Fwebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs045pd%2Fwebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs045pd%2Fwebot/lists"}