简单的微信机器人,基于wxhelper,不适合新手!!不适合新手!!不适合新手!!
Go to file
李寻欢 c7f1bf8f23
All checks were successful
BuildImage / build-image (push) Successful in 1m43s
Merge pull request '🎨 优化群聊消息总结逻辑,限制一分钟只处理四个群' (#91) from hotfix into main
Reviewed-on: #91
2024-07-27 07:40:07 +08:00
.gitea/workflows 💚 优化Actions工作流配置,只打tag事件的镜像 2023-10-25 10:02:59 +08:00
app 新增功能配置开放 2024-07-16 11:36:10 +08:00
client 🎨 优化日志打印 2023-12-08 11:41:59 +08:00
common 🔥 代码结构调整 2024-07-05 09:32:39 +08:00
config 🔥 移除短链接生成代码,疑似会引起封号 2024-07-17 08:36:34 +08:00
initialization 🎨 优化新增加好友或者群之后的响应逻辑 2024-07-11 13:56:33 +08:00
model 🎨 优化@所有人判断逻辑 2024-07-22 09:08:02 +08:00
mq 🐛 修复加群通知不提醒的BUG 2024-07-08 10:57:52 +08:00
plugin 🎨 提示语优化 2024-07-24 06:57:19 +08:00
router 新增功能配置开放 2024-07-16 11:36:10 +08:00
service 🎨 逻辑优化 2024-07-15 15:07:53 +08:00
tasks 🎨 优化群聊消息总结逻辑,限制一分钟只处理四个群 2024-07-27 06:21:40 +08:00
tcpserver 🐛 修复加群通知不提醒的BUG 2024-07-08 10:57:52 +08:00
types 🎨 消息处理逻辑优化 2023-12-04 14:17:32 +08:00
utils 🔥 移除短链接生成代码,疑似会引起封号 2024-07-17 08:36:34 +08:00
views 🎨 页面优化 2024-07-23 22:03:32 +08:00
.editorconfig 🔥 重构管理页面,长得更好看一些了 2024-04-23 10:42:08 +08:00
.gitignore 加入黑名单机制,在黑名单的Id不参与水群统计排行 2023-10-08 14:33:38 +08:00
config.yaml 🎨 管理指定群组新增模型可选范围限制 2024-07-16 15:39:45 +08:00
docker-compose.yaml 🎨 脚本优化 2024-04-09 14:42:47 +08:00
Dockerfile 🐳 脚本完善 2023-11-30 14:20:48 +08:00
go.mod 🎨 优化热榜的链接为短链 2024-07-16 13:30:06 +08:00
go.sum 🎨 优化热榜的链接为短链 2024-07-16 13:30:06 +08:00
main.go 新增功能配置开放 2024-07-16 11:36:10 +08:00
readme.md chore(go-wxhelper): add AI command functionality 🤖 2024-04-12 10:48:46 +08:00

食用方式

  1. 新建一个文件夹
mkdir wechat-hook # 名字随便写
cd wechat-hook
  1. 创建配置文件config.yaml
mkdir config # 先创建一个文件夹保存配置文件,文件名不要变
vim config.yaml # 编辑配置文件内容如下最新配置请参考项目里的config.yaml文件
# 微信HOOK配置
wechat:
  # 微信HOOK接口地址
  host: wechat:19088
  # 微信容器映射出来的vnc页面地址没有就不填
  vncUrl: http://192.168.1.175:19087/vnc_lite.html
  # 是否在启动的时候自动设置hook服务的回调
  autoSetCallback: true
  # 回调IP如果是Docker运行本参数必填如果Docker修改了映射格式为 ip:port如果使用项目提供的docker-compsoe.yaml文件启动可以填`auto`
  callback: auto

# 数据库
mysql:
  host: mysql
  port: 3306
  user: wechat
  password: wechat
  db: wechat

task:
  enable: false
  syncFriends:
      enable: true
      cron: '0 * * * *'
  waterGroup:
      enable: true
      cron:
        yesterday: '30 9 * * *' # 每天9:30
        week: '30 9 * * 1' # 每周一9:30
        month: '30 9 1 * *' # 每月1号9:30
  1. 创建docker-compose.yaml文件
version: '3.9'

services:
  wechat:
    image: lxh01/wxhelper-docker:3.9.5.81-v11-novnc # 如果不用noVNC网页就删掉后面的-novnc
    container_name: gw-wechat
    restart: unless-stopped
    environment:
      - WINEDEBUG=fixme-all
    volumes:
      - ./data/wechat:/home/app/.wine/drive_c/users/app/Documents/WeChat\ Files
    ports:
      - "19086:5900" # vnc端口
      - "19087:8080" # noVNC端口
      - "19088:19088" # 微信HOOK端口
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:19088/api/checkLogin"]
      interval: 60s
      timeout: 10s
      retries: 5


  mysql:
    image: mysql:8
    container_name: gw-db
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=wechat
      - MYSQL_USER=wechat
      - MYSQL_PASSWORD=wechat
      - MYSQL_DATABASE=wechat
    volumes:
      - ./data/db:/var/lib/mysql


  wxhelper:
    image: gitee.ltd/lxh/go-wxhelper:latest
    container_name: gw-service
    restart: unless-stopped
    depends_on:
      - mysql
      - wechat
    volumes:
      # 配置文件请参阅项目根目录的config.yaml文件
      - ./config/config.yaml:/app/config.yaml
    ports:
      - "19099:19099"

  1. 启动
# 以下命令选个能用的就行
docker-compose up -d # 老版本
docker compose up -d # 新版本

注意事项

  1. 宿主机必须是debian系,因为wine的玄学BUG,其他系统可能会出现各种问题
  2. 登录微信可以用vnc viewer连接5900端口或者访问noVNC端口的vnc_lite.html页面进行扫码登录