From d139301ea6d3996202e58180e79e8d7b64e735fe Mon Sep 17 00:00:00 2001 From: ishkong <19740260+ishkong@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:18:04 +0800 Subject: [PATCH] [OneBot] Fix tryadd key alread in result --- .../Core/Operation/Group/GetGroupHonorInfoOperation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lagrange.OneBot/Core/Operation/Group/GetGroupHonorInfoOperation.cs b/Lagrange.OneBot/Core/Operation/Group/GetGroupHonorInfoOperation.cs index 116b4a3c6..03c892d68 100644 --- a/Lagrange.OneBot/Core/Operation/Group/GetGroupHonorInfoOperation.cs +++ b/Lagrange.OneBot/Core/Operation/Group/GetGroupHonorInfoOperation.cs @@ -53,7 +53,7 @@ public async Task HandleOperation(BotContext context, JsonNode? pa { foreach (var (key, value) in Keys) { - if (json[value] is JsonObject jsonObject) // 神经病 (我也觉得) + if (json[value] is JsonObject jsonObject) // 神经病 (我也觉得) { ProcessJsonObject(jsonObject); if (honor.Type == "all" || honor.Type == "talkative") result.TryAdd(key, jsonObject.Deserialize()); @@ -67,7 +67,7 @@ public async Task HandleOperation(BotContext context, JsonNode? pa ProcessJsonObject(itemObject); } } - if (honor.Type == "all" || key.Contains(honor.Type)) result.TryAdd(key, jsonArray.Deserialize()); + if ((honor.Type == "all" && key.Contains(honorRaw)) || key.Contains(honor.Type)) result.TryAdd(key, jsonArray.Deserialize()); } } }