大佬,我用你开源的9.0.56搭的签名服务,Mirai客户端偶尔会报这个错,有影响吗
JamesLee66 发布的最新帖子
-
bot.login()报错,请大佬指导一下
mirai-core:2.16.0
fix-protocol-version:1.13.0
报错信息:
2025-01-11 13:59:40 W/Bot 18311234: KFCFactory(config=file:///Users/xxx/Downloads/qqbot/9.0.56/qqbot/KFCFactory.json) is not yet supported EncryptService with bot Bot(18311234)
java.lang.UnsupportedOperationException: repeated create EncryptService(id=18311234)
at xyz.cssxsh.mirai.tool.KFCFactory.createForBot(KFCFactory.kt:81)
at net.mamoe.mirai.internal.network.components.EncryptServiceHolderImpl.<init>(EncryptServiceHolder.kt:49)
at net.mamoe.mirai.internal.QQAndroidBot.createBotLevelComponents(QQAndroidBot.kt:288)
at net.mamoe.mirai.internal.QQAndroidBot$defaultBotLevelComponents$2.invoke(QQAndroidBot.kt:192)
at net.mamoe.mirai.internal.QQAndroidBot$defaultBotLevelComponents$2.invoke(QQAndroidBot.kt:191)
at net.mamoe.mirai.utils.LateinitMutableProperty.getValue(LateinitMutableProperty.kt:47)
at net.mamoe.mirai.internal.QQAndroidBot.getDefaultBotLevelComponents(QQAndroidBot.kt:191)
at net.mamoe.mirai.internal.QQAndroidBot.createNetworkLevelComponents(QQAndroidBot.kt:300)
at net.mamoe.mirai.internal.QQAndroidBot$createNetworkHandler$1.invoke(QQAndroidBot.kt:312)
at net.mamoe.mirai.internal.QQAndroidBot$createNetworkHandler$1.invoke(QQAndroidBot.kt:305)
at net.mamoe.mirai.internal.network.handler.selector.AbstractKeepAliveNetworkHandlerSelectorKt$KeepAliveNetworkHandlerSelector$1.createInstance(AbstractKeepAliveNetworkHandlerSelector.kt:277)
at net.mamoe.mirai.internal.network.handler.selector.AbstractKeepAliveNetworkHandlerSelector.refreshInstance(AbstractKeepAliveNetworkHandlerSelector.kt:249)
at net.mamoe.mirai.internal.network.handler.selector.AbstractKeepAliveNetworkHandlerSelector.getCurrentInstanceOrCreate(AbstractKeepAliveNetworkHandlerSelector.kt:57)
at net.mamoe.mirai.internal.network.handler.selector.SelectorNetworkHandler.getContext(SelectorNetworkHandler.kt:51)
at net.mamoe.mirai.internal.AbstractBot$network$2.invoke(AbstractBot.kt:139)
at net.mamoe.mirai.internal.AbstractBot$network$2.invoke(AbstractBot.kt:137)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at net.mamoe.mirai.internal.AbstractBot.getNetwork(AbstractBot.kt:137)
at net.mamoe.mirai.internal.QQAndroidBot.getComponents(QQAndroidBot.kt:189)
at net.mamoe.mirai.internal.AbstractBot.login(AbstractBot.kt:156)
at net.mamoe.mirai.Bot$login$1.invoke(Bot.kt:65535)
at net.mamoe.mirai.Bot$login$1.invoke(Bot.kt)
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:205)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith$$$capture(ContinuationImpl.kt:33)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt)
at --- Async.Stack.Trace --- (captured by IntelliJ IDEA debugger)
at kotlinx.coroutines.debug.internal.DebugProbesImpl$CoroutineOwner.<init>(DebugProbesImpl.kt:532)
at kotlinx.coroutines.debug.internal.DebugProbesImpl.createOwner(DebugProbesImpl.kt:511)
at kotlinx.coroutines.debug.internal.DebugProbesImpl.probeCoroutineCreated$kotlinx_coroutines_core(DebugProbesImpl.kt:500)
at kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineCreated(DebugProbes.kt:10)
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:87)
at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
at me.him188.kotlin.jvm.blocking.bridge.internal.RunSuspendKt.$runSuspend$(RunSuspend.kt:18)
at net.mamoe.mirai.Bot.login(Bot.kt)
at com.xxx.modules.qqbot.qq.QQBot.init(QQBot.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:305)
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190)
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:108)
at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at com.xxx.QQBotServerApplication.main(QQBotServerApplication.java:18)2025-01-11 13:59:40 I/Bot 1831766473: Bot cancelled: Bot closed
-
图片下载失败
在消息链中获取到imageId,根据imageId构造Image对象,通过String imageUrl = Image.queryUrl(image);获取下载链接,下载链接打不开
mirai-core 版本
2.16.0
bot-protocol
ANDROID_PAD
复现代码:
String imageId = "{57454715-A857-BAD2-D863-CA717CB64A5B}.jpg"; Image.Builder builder = Image.newBuilder(imageId); builder.setType(ImageType.valueOf(imageMessage.getImageType())); builder.setWidth(imageMessage.getWidth()); builder.setHeight(imageMessage.getHeight()); builder.setSize(imageMessage.getSize()); builder.setEmoji(imageMessage.getEmoji()); Image image = builder.build(); String imageUrl = Image.queryUrl(image);