简单的微信机器人,基于wxhelper,不适合新手!!不适合新手!!不适合新手!!
李寻欢
ba6d5fa98c
All checks were successful
BuildImage / build-image (push) Successful in 1m35s
Reviewed-on: #79 |
||
---|---|---|
.gitea/workflows | ||
app | ||
client | ||
common | ||
config | ||
initialization | ||
model | ||
mq | ||
plugin | ||
router | ||
service | ||
tasks | ||
tcpserver | ||
types | ||
utils | ||
views | ||
.editorconfig | ||
.gitignore | ||
config.yaml | ||
docker-compose.yaml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
main.go | ||
readme.md |
食用方式
- 新建一个文件夹
mkdir wechat-hook # 名字随便写
cd wechat-hook
- 创建配置文件
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
- 创建
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"
- 启动
# 以下命令选个能用的就行
docker-compose up -d # 老版本
docker compose up -d # 新版本
注意事项
- 宿主机必须是
debian
系,因为wine
的玄学BUG
,其他系统可能会出现各种问题 - 登录微信可以用
vnc viewer
连接5900
端口或者访问noVNC
端口的vnc_lite.html
页面进行扫码登录