Skip to content

Commit

Permalink
[OneBot] Fix tryadd key alread in result
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkong authored Nov 8, 2024
1 parent 2e14449 commit d139301
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task<OneBotResult> 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<JsonNode>());
Expand All @@ -67,7 +67,7 @@ public async Task<OneBotResult> HandleOperation(BotContext context, JsonNode? pa
ProcessJsonObject(itemObject);
}
}
if (honor.Type == "all" || key.Contains(honor.Type)) result.TryAdd(key, jsonArray.Deserialize<JsonNode>());
if ((honor.Type == "all" && key.Contains(honorRaw)) || key.Contains(honor.Type)) result.TryAdd(key, jsonArray.Deserialize<JsonNode>());
}
}
}
Expand Down

0 comments on commit d139301

Please sign in to comment.