MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Solved 在Linux上运行时找不到Bot实例

    开发交流
    2
    6
    88
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ConstantineQAQ
      ConstantineQAQ last edited by

      64c1b32d-bf4e-4bc5-bdb7-776c1ef4de2c-image.png
      在本地运行是好的,但是在Linux上就会报错说找不到Bot实例

      1 Reply Last reply Reply Quote 0
      • cssxsh
        cssxsh last edited by

        为啥 logs 里明明有 log 文件,非得要截图

        1 Reply Last reply Reply Quote 0
        • cssxsh
          cssxsh last edited by cssxsh

          在正常的启动流程里 插件 onEnable 阶段时,自动登录还没有触发,是拿不到 bot 实例的

          如果你用的是旧版的测试启动方式 runTerminal,你测试时 自动登录已经触发,这和真实环境是不同的
          runTerminal 已经废弃,请升级 mirai gradle 插件版本,使用新版 的 task 测试 runConsole

          1 Reply Last reply Reply Quote 0
          • ConstantineQAQ
            ConstantineQAQ last edited by

            @cssxsh 问题已经解决了,但是我想知道怎么升级miraigradle插件版本

            cssxsh 1 Reply Last reply Reply Quote 0
            • cssxsh
              cssxsh @ConstantineQAQ last edited by

              @ConstantineQAQ

              build.gradle.kts 里 第三四 行左右
              id("net.mamoe.mirai-console") version "xxxx"
              xxx 就是 mirai console gradle 插件版本,和 mirai 版本是 同步的
              你可以改成 2.12.2,最新稳定版

              ConstantineQAQ 1 Reply Last reply Reply Quote 0
              • ConstantineQAQ
                ConstantineQAQ @cssxsh last edited by

                @cssxsh 好的,谢谢

                1 Reply Last reply Reply Quote 0
                • Topic has been marked as solved  ConstantineQAQ ConstantineQAQ 
                • 1 / 1
                • First post
                  Last post
                Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact