-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
log:
fail: Lagrange.Core.Internal.Context.EventContext[955647033]
Handle trpc.msg.olpush.OlPushService.MsgPush server packet failed
Lagrange.Core.Exceptions.LagrangeException: An error occurred while processing the incoming event
---> System.Collections.Generic.KeyNotFoundException: The given key 'action_str' was not present in the dictionary.
at Lagrange.Core.Internal.Logic.Processors.GroupNudgeProcessor.Handle(BotContext context, MsgType msgType, Int32 subType, PushMessageEvent msgEvt, Nullable`1 content) + 0x413
at Lagrange.Core.Internal.Logic.PushLogic.<Incoming>d__3.MoveNext() + 0x26d
--- End of stack trace from previous location ---
at Lagrange.Core.Internal.Context.EventContext.<HandleIncomingEvent>d__6.MoveNext() + 0x111
--- End of inner exception stack trace ---
at Lagrange.Core.Internal.Context.EventContext.<HandleIncomingEvent>d__6.MoveNext() + 0x29f
--- End of stack trace from previous location ---
at Lagrange.Core.Internal.Context.EventContext.<HandleServerPacket>d__9.MoveNext() + 0xed
缺少字段action_str
结论:
部分戳一戳没有action_str,用的是alt_str1
可能的修复:
diff --git a/Lagrange.Core/Internal/Logic/Processors/GroupNudgeProcessor.cs b/Lagrange.Core/Internal/Logic/Processors/GroupNudgeProcessor.cs
index 602d264..2bdba73 100644
--- a/Lagrange.Core/Internal/Logic/Processors/GroupNudgeProcessor.cs
+++ b/Lagrange.Core/Internal/Logic/Processors/GroupNudgeProcessor.cs
@@ -24,10 +24,14 @@ internal class GroupNudgeProcessor : MsgPushProcessorBase
if (greyTip.GeneralGrayTip.BusiType == 12) // poke
{
+ if (!@params.TryGetValue("action_str", out var actionStr))
+ {
+ _ = @params.TryGetValue("alt_str1", out actionStr);
+ }
context.EventInvoker.PostEvent(new BotGroupNudgeEvent(
groupUin,
long.Parse(@params["uin_str1"]),
- @params["action_str"],
+ actionStr ?? string.Empty,
@params["action_img_url"],
long.Parse(@params["uin_str2"]),
@params["suffix_str"]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels