修改 mirai core 使其支持新版NTQQ图床
-
放到了GitHub上的我魔改的项目里
使用方法
1.前往使mirai支持新NT图床方法下载
mirai-core-all-2.17.0-all.jar
和mirai-core-all-2.17.0-all.jar.sha1
2.将
mirai-core-all-2.17.0-all.jar
和mirai-core-all-2.17.0-all.jar.sha1
放入libs
文件夹3.修改
config.json
中的内容,将"net.mamoe:mirai-core-all": { "channel": "maven-stable", "version": "2.16.0", "type": "libs", "versionLocked": false }
修改为
"net.mamoe:mirai-core-all": { "channel": "maven-stable", "version": "2.17.0", "type": "libs", "versionLocked": true }
修改来源mamoe/mirai/Pull request #2860,文件来自Actions构建mamoe/mirai/Build #5103
-
收到,阅
-
收到,阅
-
-
2024-09-24T23:38:07.269+08:00 DEBUG 32628 --- [atcher-worker-4] c.h.qqbot.plugins.SAVE_LALAFELL_IMAGE : [mirai:image:{FB5687F4-E2A7-0161-704A-E7234E213061}.png, width=2560, height=1440, size=3618097, type=PNG, isEmoji=false]
2024-09-24T23:38:07.269+08:00 DEBUG 32628 --- [atcher-worker-4] c.h.qqbot.plugins.SAVE_LALAFELL_IMAGE : 提取的id: FB5687F4-E2A7-0161-704A-E7234E213061
2024-09-24T23:38:07.269+08:00 DEBUG 32628 --- [atcher-worker-4] c.h.qqbot.plugins.SAVE_LALAFELL_IMAGE : 提取的类型: png
无法下载图片,URL无效或访问受限: http://gchat.qpic.cn/gchatpic_new/3555202423/0-0-FB5687F4E2A70161704AE7234E213061/0?term=2
java.io.FileNotFoundException: http://gchat.qpic.cn/gchatpic_new/3555202423/0-0-FB5687F4E2A70161704AE7234E213061/0?term=2
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at com.hmmt.qqbot.common.util.HMMTTool.saveImage(HMMTTool.java:99)
at com.hmmt.qqbot.plugins.SAVE_LALAFELL_IMAGE.saveLalaFellImag(SAVE_LALAFELL_IMAGE.java:80)
at com.hmmt.qqbot.plugins.SAVE_LALAFELL_IMAGE.SAVE_LALAFELL_IMAGE(SAVE_LALAFELL_IMAGE.java:51)
at com.hmmt.qqbot.listener.GroupMessageEventListener.onEvent(GroupMessageEventListener.java:159)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at net.itbaima.robot.event.handle.HandlerResolver.invokeMethod(HandlerResolver.java:103)
at net.itbaima.robot.event.handle.HandlerResolver.lambda$addHandlerMethod$4(HandlerResolver.java:88)
at net.itbaima.robot.event.handle.EventHandler.acceptIfContainsId(EventHandler.java:21)
at net.itbaima.robot.event.handle.HandlerResolver.lambda$subscribe$1(HandlerResolver.java:61)
at java.base/java.util.PriorityQueue.forEach(PriorityQueue.java:969)
at net.itbaima.robot.event.handle.HandlerResolver.lambda$subscribe$2(HandlerResolver.java:45)
at java.base/java.util.HashMap$KeySet.forEach(HashMap.java:1008)
at net.itbaima.robot.event.handle.HandlerResolver.lambda$subscribe$3(HandlerResolver.java:43)
at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
at net.mamoe.mirai.event.EventChannel$subscribeAlways$2$1.invoke(EventChannel.kt:605)
at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51)
at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1)
at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
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)更改了版本后能获取到对应的图片id了 请问如何获取图片的下载链接呢
-
"http://" + delegate.info.noKeyDownloadInfo.domain + "/download?appid=1407&fileid=" + delegate.info.msgInfo.fileId + senderMeta.origUrl
-
@rs610ucf7 在 修改 mirai core 使其支持新版NTQQ图床 中说:
"http://" + delegate.info.noKeyDownloadInfo.domain + "/download?appid=1407&fileid=" + delegate.info.msgInfo.fileId + senderMeta.origUrl
请问在java中如何调用呢 我尝试对照源码获取ImMsgBody对象 但是提示我使用了来自不同模块的 Kotlin 内部声明
-
@HMMT 这我就不太会了,我的水平只够魔改/整合
-