MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接

    修改 mirai core 使其支持新版NTQQ图床

    其他项目发布
    6
    12
    933
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • R
      rs610ucf7 摸鱼 最后由 rs610ucf7 编辑

      放到了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

      1 条回复 最后回复 回复 引用 3
      • 何梓Black
        何梓Black 最后由 编辑

        收到,阅

        1 条回复 最后回复 回复 引用 1
        • Moyuyanli
          Moyuyanli 摸鱼 最后由 编辑

          收到,阅

          1 条回复 最后回复 回复 引用 1
          • Referenced by  R rs610ucf7 
          • H
            HMMT 最后由 编辑

            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了 请问如何获取图片的下载链接呢

            R 1 条回复 最后回复 回复 引用 0
            • R
              rs610ucf7 摸鱼 @HMMT 最后由 编辑

              @HMMT

              "http://" + delegate.info.noKeyDownloadInfo.domain + "/download?appid=1407&fileid=" + delegate.info.msgInfo.fileId + senderMeta.origUrl
              
              H 1 条回复 最后回复 回复 引用 0
              • H
                HMMT @rs610ucf7 最后由 编辑

                @rs610ucf7 在 修改 mirai core 使其支持新版NTQQ图床 中说:

                @HMMT

                "http://" + delegate.info.noKeyDownloadInfo.domain + "/download?appid=1407&fileid=" + delegate.info.msgInfo.fileId + senderMeta.origUrl
                

                请问在java中如何调用呢 我尝试对照源码获取ImMsgBody对象 但是提示我使用了来自不同模块的 Kotlin 内部声明

                R J 2 条回复 最后回复 回复 引用 0
                • R
                  rs610ucf7 摸鱼 @HMMT 最后由 编辑

                  @HMMT 这我就不太会了,我的水平只够魔改/整合

                  H 1 条回复 最后回复 回复 引用 0
                  • H
                    HMMT @rs610ucf7 最后由 编辑

                    @rs610ucf7 在 修改 mirai core 使其支持新版NTQQ图床 中说:

                    @HMMT 这我就不太会了,我的水平只够魔改/整合

                    好的 谢谢dalao

                    1 条回复 最后回复 回复 引用 0
                    • I
                      IsaacSuo 最后由 编辑

                      帅,大佬帅

                      1 条回复 最后回复 回复 引用 0
                      • Referenced by  R rs610ucf7 
                      • Referenced by  J JamesLee66 
                      • J
                        JamesLee66 @HMMT 最后由 编辑

                        @HMMT 大佬,这个问题解决了吗

                        H 1 条回复 最后回复 回复 引用 0
                        • H
                          HMMT @JamesLee66 最后由 编辑

                          @JamesLee66 我没有解决 我已经在逐步把我的mirai迁移到其他框架上了 或者你可以试试overflow overflow+mirai应该也可以解决这个问题

                          1 条回复 最后回复 回复 引用 0
                          • J
                            JamesLee66 最后由 编辑

                            好的

                            1 条回复 最后回复 回复 引用 0
                            • 1 / 1
                            • First post
                              Last post
                            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact