2024-06-20T21:36:21.228+08:00 INFO 13358 --- [nano-qq] [atcher-worker-2] f.f.n.h.request.FriendRequestHandler : 通过了 xxx (xxx) 的好友请求
2024-06-20T21:36:21.237+08:00 INFO 13358 --- [nano-qq] [atcher-worker-7] f.f.n.h.request.FriendRequestHandler : 通过了 yyy (yyy) 的好友请求
2024-06-20T21:36:24.155+08:00 INFO 13358 --- [nano-qq] [atcher-worker-2] f.f.n.h.request.FriendRequestHandler : 通过了 xxx (xxx) 的好友请求
Exception in thread "DefaultDispatcher-worker-10" java.lang.IllegalStateException: Failed to resolve raw event {"time":1718890671,"self_id":xxx,"post_type":"notice","notice_type":"notify","sub_type":"poke","target_id":zzz,"user_id":yyy,"sender_id":yyy}, session and bot will be closed exceptionally
at love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl$WsEventSession.receiveEvent(OneBotBotImpl.kt:457)
at love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl$WsEventSession.access$receiveEvent(OneBotBotImpl.kt:278)
at love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl$WsEventSession$receiveEvent$1.invokeSuspend(OneBotBotImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@1a1e5442, Dispatchers.Default]
Caused by: kotlinx.serialization.MissingFieldException: Field 'group_id' is required for type with serial name 'love.forte.simbot.component.onebot.v11.event.notice.RawNotifyEvent', but it was missing
at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
at love.forte.simbot.component.onebot.v11.event.notice.RawNotifyEvent.<init>(RawNotifyEvent.kt:44)
at love.forte.simbot.component.onebot.v11.event.notice.RawNotifyEvent$$serializer.deserialize(RawNotifyEvent.kt:44)
at love.forte.simbot.component.onebot.v11.event.notice.RawNotifyEvent$$serializer.deserialize(RawNotifyEvent.kt:44)
at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:77)
at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:52)
at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:25)
at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:127)
at love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl$WsEventSession.resolveRawEvent(OneBotBotImpl.kt:504)
at love.forte.simbot.component.onebot.v11.core.bot.internal.OneBotBotImpl$WsEventSession.receiveEvent(OneBotBotImpl.kt:452)
... 8 more
系统版本
docker image: mlikiowa/napcat-docker:latest
QQNT 版本
docker image
NapCat 版本
docker image
OneBot 客户端
simple-robot/simbot-component-onebot 0.6.0
发生了什么?
添加好友后,bot 会收到2-3个好友请求,其中一个是真实请求事件,另外一个事件里的 user_id 是完全无关的陌生人。用框架尝试接受这个异常好友请求后 bot 会主动发送好友请求给这个人。用同一个账号删除 bot 好友后再添加好友,异常事件里的陌生人 ID 是同一个人,我没有用其它账号测试过。
接受好友请求后,会收到一个 poke 事件。
但是并没有任何人戳一戳。
具体见 https://github.com/simple-robot/simbot-component-onebot/issues/47#issuecomment-2180536880 。
如何复现
好友请求事件处理代码:
期望的结果?
只收到一个好友请求事件,并且信息正确。
NapCat 运行日志
OneBot 客户端运行日志
这里 bot 实际上应该只收到了一次好友请求。