⬆️ 更新依赖gitee.ltd/lxh/xybot至v0.0.4,调整消息同步频率至每秒一次
All checks were successful
BuildImage / build-image (push) Successful in 8m20s

This commit is contained in:
李寻欢 2025-04-23 15:26:27 +08:00
parent dd1f9376c5
commit b839e4991a
4 changed files with 6 additions and 2 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module gitee.ltd/lxh/wechat-robot
go 1.24.0
require (
gitee.ltd/lxh/xybot v0.0.3
gitee.ltd/lxh/xybot v0.0.4
github.com/docker/docker v28.1.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/go-co-op/gocron/v2 v2.16.1

2
go.sum
View File

@ -2,6 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
gitee.ltd/lxh/xybot v0.0.3 h1:/xRCnW2nMtx/hdV7TdpEcL3Sh8f9oBGHToONk0yGstA=
gitee.ltd/lxh/xybot v0.0.3/go.mod h1:jYfEAQ3WPsST/PY4fEEVFjU6KtMocxn3sQi78I+vdxc=
gitee.ltd/lxh/xybot v0.0.4 h1:sEs6ZOZud2oDWvW1MVpwHWJUq3AyxYA1G/SGP4En+/0=
gitee.ltd/lxh/xybot v0.0.4/go.mod h1:jYfEAQ3WPsST/PY4fEEVFjU6KtMocxn3sQi78I+vdxc=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=

View File

@ -40,10 +40,12 @@ func syncMessage(client *xybot.Client, robotId uint) {
// 没有消息,直接返回
return
}
//log.Debugf("当前同步机器人Id: %d消息数量: %d客户端信息: %+v", robotId, len(messages), client)
// 处理消息
var msg []model.Message
for _, message := range messages {
//log.Debugf("当前同步机器人Id: %d消息内容: %s", robotId, message.Content.String)
var m model.Message
m.RobotId = robotId
m.MsgId = message.NewMsgId

View File

@ -53,7 +53,7 @@ func AddJob(robot model.Robot) {
}
job, err := scheduler.NewJob(
gocron.CronJob("*/5 * * * * *", true), // 五秒钟同步一次
gocron.CronJob("*/1 * * * * *", true), // 1秒钟同步一次
gocron.NewTask(syncMessage, robotCli, robot.ID),
)
if err != nil {