simple-robot / simbot-component-qq-guild

一个 Kotlin 多平台的QQ机器人(包括群聊) SDK,一个 Simple Robot 的组件库。对接官方API,Java 友好、异步高效 😻😻😽
https://simbot.forte.love/component-qq-guild.html
GNU Lesser General Public License v3.0
20 stars 1 forks source link

事件类型 `PUBLIC_MESSAGE_DELETE` 解析错误 #37

Open ForteScarlet opened 2 years ago

ForteScarlet commented 2 years ago
love.forte.simbot.SimbotIllegalStateException: Unknown event type: PUBLIC_MESSAGE_DELETE. data: Dispatch(data={"message":{"author":{"bot":false,"id":"xxx","username":"xxx"},"channel_id":"xxx","guild_id":"xxx","id":"xxx"},"op_user":{"id":"14072671896854096427"}}, type=PUBLIC_MESSAGE_DELETE, seq=3)
    at love.forte.simbot.tencentguild.core.internal.TencentGuildBotImpl$processEvent$3.invokeSuspend(TencentGuildBotImpl.kt:438)
    at love.forte.simbot.tencentguild.core.internal.TencentGuildBotImpl$processEvent$3.invoke(TencentGuildBotImpl.kt)
    at love.forte.simbot.tencentguild.core.internal.TencentGuildBotImpl$processEvent$3.invoke(TencentGuildBotImpl.kt)
    at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Emitters.kt:223)
    at love.forte.simbot.tencentguild.core.internal.TencentGuildBotImpl$processEvent$$inlined$mapNotNull$1$2.emit(Emitters.kt:245)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt(Channels.kt:1)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Channels.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
ForteScarlet commented 1 year ago

重构后还未测试

ForteScarlet commented 1 year ago
Received text frame raw: {"op":0,"s":12,"t":"PUBLIC_MESSAGE_DELETE","id":"PUBLIC_MESSAGE_DELETE:xxx","d":{"message":{"author":{"bot":false,"id":"xxx","username":"xxx"},"channel_id":"xxx","guild_id":"xxx","id":"xxx"},"op_user":{"id":"xxx"}}}
Exception in thread "DefaultDispatcher-worker-5" kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for class discriminator 'PUBLIC_MESSAGE_DELETE'
JSON input: .....xxx"},"op_user":{"id":"xxx"}}}
        at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
        at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
        at kotlinx.serialization.json.internal.PolymorphicKt.throwSerializerNotFound(Polymorphic.kt:79)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:68)
        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:116)
        at love.forte.simbot.qguild.internal.BotImpl$ReceiveEvent.invoke(BotImpl.kt:653)
        at love.forte.simbot.qguild.internal.BotImpl$ReceiveEvent$invoke$1.invokeSuspend(BotImpl.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
        Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [CoroutineName(QGBot.101986850), StandaloneCoroutine{Cancelling}@90429c5, Dispatchers.Default]
ForteScarlet commented 1 year ago

截至目前文档中尚无此事件的说明,无法进行支持。