From 44498e1846d0272899b67d7e14d908188fbbe93a Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:27:54 +0800 Subject: [PATCH 1/2] beta338 (#342) --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 90341e90..56be0d40 100644 --- a/readme.md +++ b/readme.md @@ -45,7 +45,7 @@ _✨ 基于 [OneBot](https://github.com/howmanybots/onebot/blob/master/README.md

## 引用 -- [`tencent-connect/botgo`](https://github.com/tencent-connect/botgo): 本项目引用了此项目,并做了一点改动. +- [`tencent-connect/botgo`](https://github.com/tencent-connect/botgo): 本项目引用了此项目,并做了一些改动. ## 兼容性 gensokyo兼容 [OneBot-v11](https://github.com/botuniverse/onebot-11) ,并在其基础上做了一些扩展,详情请看 OneBot 的文档。 From 8c1bc04c7790ea10ee13c4baf5e8fe4e07b514d4 Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Wed, 6 Mar 2024 00:02:36 +0800 Subject: [PATCH 2/2] Beta339 (#343) * beta338 * beta319 --- config/config.go | 13 +++++++++++++ main.go | 5 +++-- template/config_template.go | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 205fc97e..e602bb82 100644 --- a/config/config.go +++ b/config/config.go @@ -151,6 +151,7 @@ type Settings struct { AutoPutInteraction bool `yaml:"auto_put_interaction"` PutInteractionDelay int `yaml:"put_interaction_delay"` ImgUpApiVtv2 bool `yaml:"img_up_api_ntv2"` + Fix11300 bool `yaml:"fix_11300"` } // LoadConfig 从文件中加载配置并初始化单例配置 @@ -1870,3 +1871,15 @@ func GetImgUpApiVtv2() bool { } return instance.Settings.ImgUpApiVtv2 } + +// 获取Fix11300开关 +func GetFix11300() bool { + mu.Lock() + defer mu.Unlock() + + if instance == nil { + mylog.Println("Warning: instance is nil when trying to Fix11300 value.") + return false + } + return instance.Settings.Fix11300 +} diff --git a/main.go b/main.go index 1cbe9545..d3282d49 100644 --- a/main.go +++ b/main.go @@ -155,8 +155,9 @@ func main() { } configURL := config.GetDevelop_Acdir() + fix11300 := config.GetFix11300() var me *dto.User - if configURL == "" { // 执行API请求 显示机器人信息 + if configURL == "" && !fix11300 { // 执行API请求 显示机器人信息 me, err = api.Me(ctx) // Adjusted to pass only the context if err != nil { log.Printf("Error fetching bot details: %v\n", err) @@ -168,7 +169,7 @@ func main() { log.Printf("自定义ac地址模式...请从日志手动获取bot的真实id并设置,不然at会不正常") } if !nologin { - if configURL == "" { //初始化handlers + if configURL == "" && !fix11300 { //初始化handlers handlers.BotID = me.ID } else { //初始化handlers handlers.BotID = config.GetDevBotid() diff --git a/template/config_template.go b/template/config_template.go index 103b418f..a73f3442 100644 --- a/template/config_template.go +++ b/template/config_template.go @@ -134,7 +134,8 @@ settings: shard_id: 0 #当前分片id 默认从0开始,详细请看 https://bot.q.qq.com/wiki/develop/api/gateway/reference.html auto_put_interaction : false #自动回应按钮回调的/interactions/{interaction_id} 注本api需要邮件申请,详细方法参考群公告:196173384 put_interaction_delay : 0 #单位毫秒 表示回应已收到回调类型的按钮的毫秒数 会按用户进行区分 非全局delay - img_up_api_ntv2: false #gsk内建图片上传api 是否将图片转换为ntqq图床url(md发图用,自行调用)文档: + img_up_api_ntv2: false #gsk内建图片上传api 是否将图片转换为ntqq图床url(md发图用,自行调用)文档:https://www.yuque.com/km57bt/hlhnxg/ig2nk88fccykn6dm + fix_11300: false #修复11300报错,需要在develop_bot_id填入自己机器人的appid. 11300原因暂时未知,临时修复方案. title : "Gensokyo © 2023 - Hoshinonyaruko" #程序的标题 如果多个机器人 可根据标题区分 custom_bot_name : "Gensokyo全域机器人" #自定义机器人名字,会在api调用中返回,默认Gensokyo全域机器人