From a5d1b79cd2f495cf43062c05ad3a004a3310db7f Mon Sep 17 00:00:00 2001 From: SanaeFox <36219542+Hoshinonyaruko@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:17:30 +0800 Subject: [PATCH] Beta145 (#144) * beta1 * beta2 * beta3 * beta4 * beta5 * beta6 * beta7 * beta8 * beta9 * beta10 * beta11 * beta12 * beta13 * beta14 * beta15 * beta16 * beta16 * beta19 * beta20 * beta21 * beta22 * beta23 * beta24 * beta25 * beta27 * beta28 * beta29 * beta30 * beta31 * beta33 * beta34 * beta35 * beta36 * beta37 * beta38 * beta39 * beta40 * beta41 * beta42 * beta43 * beta44 * beta45 * beta45 * beta46 * beat48 * beta49 * beta50 * beta51 * beta52 * beta53 * beta54 * beta55 * beta57 * beta58 * beta59 * beta61 * beta62 * beta63 * beta63 * beta64 * beta65 * beta66 * beta67 * beta70 * beta71 * beta72 * beta72 * beta74 * beta75 * beta76 * beta77 * beta78 * beta79 * beta80 * beta81 * beta82 * beta83 * beta85 * beta86 * beta87 * beta88 * beta89 * beta90 * beta91 * beta92 * beta93 * beta94 * beta94 * beta96 * beta97 * beta98 * beta99 * beta100 * beta101 * beta102 * beta104 * beta105 * beta106 * beta107 * beta108 * beta109 * beta110 * beta111 * beta112 * beta113 * beta115 * beta116 * beta117 * beta118 * beta119 * beta120 * beta121 * beta122 * beta123 * beta124 * beta125 * beta126 * beta127 * beta128 * beta129 * beta130 * beta131 * beta132 * beta1333 * beta134 * beta135 * beta136 * beta137 * beta138 * beta139 * beta140 * beta141 * beta142 * beta143 * beta144 * beta145 --- applogic/gensokyo.go | 2 +- utils/utils.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/applogic/gensokyo.go b/applogic/gensokyo.go index 68266fd..226413e 100644 --- a/applogic/gensokyo.go +++ b/applogic/gensokyo.go @@ -154,7 +154,7 @@ func (app *App) GensokyoHandler(w http.ResponseWriter, r *http.Request) { checkstr := utils.RemoveBracketsContent(message.RawMessage) if !checkMessageForHints(checkstr, message.SelfID, promptstr) { // 获取概率值 - chance := config.GetGroupHintChance() + chance := config.GetGroupHintChance(promptstr) // 生成0-100之间的随机数 randomValue := rand.Intn(100) diff --git a/utils/utils.go b/utils/utils.go index 210bd20..659c37e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -951,13 +951,13 @@ func RemoveAtTagContentConditional(input string, message structs.OnebotGroupMess // 可以都是2 打开 呈现覆盖关系 if config.GetGroupAddCardToQ(promptstr) == 2 { if message.Sender.Card != "" { - name = "[name:" + message.Sender.Card + "]" + name = "[username:" + message.Sender.Card + "]" } } if config.GetGroupAddNicknameToQ(promptstr) == 2 && name == "" { if message.Sender.Nickname != "" { - name = "[name:" + message.Sender.Nickname + "]" + name = "[username:" + message.Sender.Nickname + "]" } } @@ -965,7 +965,7 @@ func RemoveAtTagContentConditional(input string, message structs.OnebotGroupMess // 遍历特殊名称数组,检查是否需要进行进一步替换 for _, replacement := range specialNames { if useridstr == replacement.ID { - name = "[name:" + replacement.Name + "]" + name = "[username:" + replacement.Name + "]" break // 找到匹配,跳出循环 } } @@ -989,13 +989,13 @@ func RemoveAtTagContentConditional(input string, message structs.OnebotGroupMess // 可以都是2 打开 呈现覆盖关系 if config.GetGroupAddCardToQ(promptstr) == 2 { if message.Sender.Card != "" { - name = "[name:" + message.Sender.Card + "]" + name = "[username:" + message.Sender.Card + "]" } } if config.GetGroupAddNicknameToQ(promptstr) == 2 && name == "" { if message.Sender.Nickname != "" { - name = "[name:" + message.Sender.Nickname + "]" + name = "[username:" + message.Sender.Nickname + "]" } } @@ -1003,7 +1003,7 @@ func RemoveAtTagContentConditional(input string, message structs.OnebotGroupMess // 遍历特殊名称数组,检查是否需要进行进一步替换 for _, replacement := range specialNames { if useridstr == replacement.ID { - name = "[name:" + replacement.Name + "]" + name = "[username:" + replacement.Name + "]" break // 找到匹配,跳出循环 } } @@ -1018,21 +1018,21 @@ func RemoveAtTagContentConditional(input string, message structs.OnebotGroupMess // 可以都是2 打开 呈现覆盖关系 if config.GetGroupAddCardToQ(promptstr) == 2 { if message.Sender.Card != "" { - name = "[name:" + message.Sender.Card + "]" + name = "[username:" + message.Sender.Card + "]" } } // 将CQat标签替换为名字 if config.GetGroupAddNicknameToQ(promptstr) == 2 && name == "" { if message.Sender.Nickname != "" { - name = "[name:" + message.Sender.Nickname + "]" + name = "[username:" + message.Sender.Nickname + "]" } } // 遍历特殊名称数组,检查是否需要进行进一步替换 for _, replacement := range specialNames { if match[1] == replacement.ID { - name = "[name:" + replacement.Name + "]" + name = "[username:" + replacement.Name + "]" break // 找到匹配,跳出循环 } }