project-mirai / mirai-api-http

Mirai HTTP API (console) plugin
GNU Affero General Public License v3.0
1.66k stars 343 forks source link

MessageFromID 使用MessageId查询消息接口报错 #625

Closed MDeath closed 1 year ago

MDeath commented 2 years ago

2022-09-10 08:22:55 E/MAH Access: kotlinx.serialization.UnknownFieldException: An unknown field for index -3
kotlinx.serialization.UnknownFieldException: An unknown field for index -3
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MessageIdDTO$$serializer.deserialize(message.kt:55)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MessageIdDTO$$serializer.deserialize(message.kt:55)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedGet$7$1.invokeSuspend(dsl.kt:197)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedGet$7$1.invoke(dsl.kt)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.router.MessageKt$messageRouter$1$invoke$$inlined$httpAuthedGet$7$1.invoke(dsl.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.routing.Routing.executeResult(Routing.kt:155)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.routing.Routing.interceptor(Routing.kt:39)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invokeSuspend(Authorization.kt:41)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.intercept(HttpRouterAccessHandler.kt:36)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.access$intercept(HttpRouterAccessHandler.kt:25)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invokeSuspend(HttpRouterAccessHandler.kt:91)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)
    at mirai-api-http-v2.6.2.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:127)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78)
    at mirai-api-http-v2.6.2.mirai2.jar[shared]//io.ktor.server.cio.CIOApplicationEngine$handleRequest$2.invokeSuspend(CIOApplicationEngine.kt:196)
    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)
```
ryoii commented 2 years ago

MessageFromID 接口应该是更新了接口,你升级了最新版的话最好看一下更新日志或者文档

MDeath commented 2 years ago

MessageFromID 接口应该是更新了接口,你升级了最新版的话最好看一下更新日志或者文档 我看过了,也有附带对应的target

ryoii commented 1 year ago

最新应该使用

{
  "target": 123,
  "messageId": 123,
}

文档已修正