project-mirai / mirai-api-http

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

2.6.1上传文件接口与通过id获取消息接口 #605

Closed Controllerdestiny closed 2 years ago

Controllerdestiny commented 2 years ago

上传文件接口,能正常返回数据但群里没有文件被上传,控制台没有任何信息。

通过id获取消息{"code":500,"msg":"An unknown field for index -3"}只返回这个

Controllerdestiny commented 2 years ago

获取消息接口报错

kotlinx.serialization.UnknownFieldException: An unknown field for index -3 at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MessageIdDTO$$serializer.deserialize(message.kt:55) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MessageIdDTO$$serializer.deserialize(message.kt:55) at mirai-api-http-v2.6.1.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.1.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.1.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.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.routing.Routing.executeResult(Routing.kt:155) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.routing.Routing.interceptor(Routing.kt:39) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:107) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invokeSuspend(Authorization.kt:41) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.auth.Authorization$install$1.invoke(Authorization.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.intercept(HttpRouterAccessHandler.kt:36) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler.access$intercept(HttpRouterAccessHandler.kt:25) at mirai-api-http-v2.6.1.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.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt) at mirai-api-http-v2.6.1.mirai2.jar//net.mamoe.mirai.api.http.adapter.http.feature.handler.HttpRouterAccessHandler$Feature$install$1.invoke(HttpRouterAccessHandler.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:127) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:248) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.proceed(SuspendFunctionGun.kt:116) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.SuspendFunctionGun.execute(SuspendFunctionGun.kt:136) at mirai-api-http-v2.6.1.mirai2.jar[shared]//io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:78) at mirai-api-http-v2.6.1.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) 

Controllerdestiny commented 2 years ago

顺便提一下2.6.1无法分辨闪照类型和普通图片

0f-0b commented 2 years ago

上传文件接口,能正常返回数据但群里没有文件被上传,控制台没有任何信息。

可以复现,但不清楚是不是风控……

通过id获取消息{"code":500,"msg":"An unknown field for index -3"}只返回这个

文档错了,id 应为 messageId

Controllerdestiny commented 2 years ago

上传文件接口,能正常返回数据但群里没有文件被上传,控制台没有任何信息。

可以复现,但不清楚是不是风控……

通过id获取消息{"code":500,"msg":"An unknown field for index -3"}只返回这个

文档错了,id 应为 messageId

不是风控我特意换回2.5.0试了

ryoii commented 2 years ago

594