yyuueexxiinngg / onebot-kotlin

OneBot标准的Kotlin实现及mirai插件 - 原cqhttp-mirai
GNU Affero General Public License v3.0
583 stars 139 forks source link

image ID识别错误[BUG] #103

Open zhajingwen opened 3 years ago

zhajingwen commented 3 years ago
[mirai:image:2BADBADBAD1932656990][mirai:image:5BADBADBAD1556526340][mirai:image:3BADBADBAD-375610429][mirai:image:6BADBADBAD1117326987][mirai:image:4BADBADBAD-682663619]
 12:13:41 [INFO] [BOT 3273448382] An exception was thrown under a coroutine of Bot
 12:13:41 [INFO] [NETWORK ERROR] java.lang.IllegalStateException: illegal imageId: 0BADBADBAD-191889817. ImageId must match Regex `/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}`, `/[0-9]*-[0-9]*-[0-9a-fA-F]{32}` or `\{[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\}\..{3,5}`
    at net.mamoe.mirai.message.data.MessageUtils__ImplKt.calculateImageMd5ByImageId(impl.kt:407)
    at net.mamoe.mirai.message.data.MessageUtils.calculateImageMd5ByImageId(Unknown Source)
    at net.mamoe.mirai.message.data.MessageUtils__ImageKt.calculateImageMd5(Image.kt:110)
    at net.mamoe.mirai.message.data.MessageUtils.calculateImageMd5(Unknown Source)
    at tech.mihoyo.mirai.util.CQMessgeParserKt.toCQString(CQMessgeParser.kt:247)
    at tech.mihoyo.mirai.data.common.MessageDTOKt.toDTO(MessageDTO.kt:216)
    at tech.mihoyo.mirai.data.common.BotEventDTOKt.toCQDTO(BotEventDTO.kt:27)
    at tech.mihoyo.mirai.web.http.ReportService$startReportService$2.invokeSuspend(ReportService.kt:89)
    at tech.mihoyo.mirai.web.http.ReportService$startReportService$2.invoke(ReportService.kt)
    at net.mamoe.mirai.event.SubscriberKt__SubscriberKt$subscribeAlways$1.invokeSuspend(subscriber.kt:271)
    at net.mamoe.mirai.event.SubscriberKt__SubscriberKt$subscribeAlways$1.invoke(subscriber.kt)
    at net.mamoe.mirai.event.internal.Handler$onEvent$2.invokeSuspend(InternalEventListeners.kt:89)
    at net.mamoe.mirai.event.internal.Handler$onEvent$2.invoke(InternalEventListeners.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:160)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at net.mamoe.mirai.event.internal.Handler.onEvent(InternalEventListeners.kt:89)
    at net.mamoe.mirai.event.EventKt.broadcast(Event.kt:248)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.handlePacket(QQAndroidBotNetworkHandler.kt:538)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invokeSuspend(QQAndroidBotNetworkHandler.kt:494)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$generifiedParsePacket$2.invoke(QQAndroidBotNetworkHandler.kt)
    at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.handleIncomingPacket$mirai_core_qqandroid(PacketFactory.kt:281)
    at net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.parseIncomingPacket(PacketFactory.kt:237)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.generifiedParsePacket(QQAndroidBotNetworkHandler.kt:485)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler.parsePacket(QQAndroidBotNetworkHandler.kt:480)
    at net.mamoe.mirai.qqandroid.network.QQAndroidBotNetworkHandler$parsePacketAsync$1.invokeSuspend(QQAndroidBotNetworkHandler.kt:463)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

复现

版本

cqhttp-mirai- ` <!--在``中填写你正在使用的版本号,如0.2.2.3-embedded`--> image

mirai-core-

mirai-console-

yyuueexxiinngg commented 3 years ago

应该是mirai的问题, 这里是收到消息后的转义, 尝试获取图片md5值时出错

zhajingwen commented 3 years ago

有办法解决吗