From 09c6d85cd8871e5fe7df390d7f2c9dd66969f9e1 Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Sun, 21 Jul 2024 18:33:13 +0800 Subject: [PATCH] Beta467 (#469) * beta447 * beta448 * beta449 * beta450 * beta451 * beta452 * beta453 * beta454 * beta455 * btea455 * beta456 * beta457 * beta458 * beta460 * beta460 * beta461 * beta462 * beta463 * beta464 * beta465 * beta467 --- main.go | 2 +- structs/structs.go | 1 + template/config_template.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 30b362e8..43b1d859 100644 --- a/main.go +++ b/main.go @@ -282,7 +282,7 @@ func main() { // 指定需要启动的分片数为 2 的话可以手动修改 wsInfo if conf.Settings.ShardCount == 1 { go func() { - wsInfo.Shards = 1 + wsInfo.Shards = uint32(conf.Settings.ShardNum) if err = botgo.NewSessionManager().Start(wsInfo, token, &intent); err != nil { log.Fatalln(err) } diff --git a/structs/structs.go b/structs/structs.go index 0342f095..685424c9 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -21,6 +21,7 @@ type Settings struct { ShardCount int `yaml:"shard_count"` ShardID int `yaml:"shard_id"` UseUin bool `yaml:"use_uin"` + ShardNum int `yaml:"shard_num"` //事件订阅类 TextIntent []string `yaml:"text_intent"` //转换类 diff --git a/template/config_template.go b/template/config_template.go index 13db38e5..d63d60e0 100644 --- a/template/config_template.go +++ b/template/config_template.go @@ -18,6 +18,7 @@ settings: client_secret: "" # 你的客户端密钥 shard_count: 1 #分片数量 默认1 shard_id: 0 #当前分片id 默认从0开始,详细请看 https://bot.q.qq.com/wiki/develop/api/gateway/reference.html + shard_num: 1 #接口调用超过频率限制时,如果不想要多开gsk,尝试调大.gsk会尝试连接到n个分片处理信息. n为你所配置的值.与 shard_count和shard_id互不相干. #事件订阅 text_intent: # 请根据公域 私域来选择intent,错误的intent将连接失败