MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接
    1. 主页
    2. StageGuard
    3. 帖子
    • 资料
    • 关注 2
    • 粉丝 5
    • 主题 5
    • 帖子 121
    • 最佳 14
    • 有争议的 0
    • 群组 2

    StageGuard 发布的帖子

    • RE: jvm awt 图像处理入坑/退坑指南

      确实,还得是 JBR 好用

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: 论坛还活着!

      你说得对

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: unidbg-fetch-qsign删库了

      猜测是因为qsign侧面支持了主动添加好友等高风险协议

      发布在 开发交流
      StageGuard
      StageGuard
    • RE: mirai-console怎么发送ShortVideo JAVA

      core的功能不受到console约束,使用2.16.0-rc后直接在你的代码里写就可以

      发布在 开发交流
      StageGuard
      StageGuard
    • RE: 基于mirai-core的javaWeb框架

      还不错

      发布在 其他项目发布
      StageGuard
      StageGuard
    • RE: Java如何生成配置文件

      BotConfiguration.fileBasedDeviceInfo()

      发布在 开发交流
      StageGuard
      StageGuard
    • RE: 大佬们有没有自动过滑块的解决方案

      自行解决

      发布在 开发交流
      StageGuard
      StageGuard
    • RE: 技术交流-如何实现高效率的消息过滤

      你可以自己实现一套运行时注解处理器

      发布在 开发交流
      StageGuard
      StageGuard
    • RE: 天网开发组,非官方开发交流群

      @tsudzuki 你叫什么,别叫

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: 想用多线程
      val executors = Executors.newFixedThreadPool(3)
      bot.eventChannel.subscribeAlways<MessageEvent>(executors.asCoroutineDispatcher()) {
      
      }
      
      发布在 开发交流
      StageGuard
      StageGuard
    • RE: mirai登录问题

      这是 fix-protocol-version 插件引起的问题,你应该去他的仓库反馈

      发布在 BUG反馈
      StageGuard
      StageGuard
    • 为测试 mirai 添加外置 EncryptService

      我们为 mirai 添加了新的协议内容,需要登录测试但被风控登不上时,就需要配置外置 EncryptService 辅助登录。

      关闭 android target

      PC 测试运行需要关闭 android target,在 mirai 项目根目录下创建 local.properties,添加以下属性:

      projects.mirai-core.targets=jvm;!android
      

      添加完后重新加载 gradle 项目即可。

      配置程序运行入口

      在 mirai-core/src/jvmTest/kotlin sourceSet 中创建一个新的文件 RunMirai.kt 作为程序入口。

      fun main() {
          prepareEnvironmentForDebugRun()
      
          val bot = DebugRunHelper.newBot(123456789L, BotAuthorization { session, info ->
              session.authByPassword("password")
          }) {
              protocol = BotConfiguration.MiraiProtocol.ANDROID_PHONE
              fileBasedDeviceInfo()
          }
      
          runBlocking {
              bot.login()
              bot.join()
          }
      
      }
      

      prepareEnvironmentForDebugRun() 和 DebugRunHelper.newBot() 是位于 jvmTest 的工具函数。

      为测试模块添加依赖

      以 fix-protocol-version 为例,从 release 下载 jar,放在 mirai-core/src/jvmTest/lib 中。

      编辑 mirai-core/build.gradle.kts,找到以下配置代码:

      findByName("jvmTest")?.apply {
          dependencies {
              // ...
          }
      }
      

      在 dependencies 里添加:

      implementation(files("src/jvmTest/lib/fix-protocol-version-1.9.6.mirai2.jar"))
      implementation("org.asynchttpclient:async-http-client:2.12.3") // fix-protocol-version 的依赖项
      

      配置 EncryptService

      编辑 RunMirai.kt,在 DebugRunHelper.newBot() 之前手动注册 EncryptService。

      import net.mamoe.mirai.utils.Services
      import xyz.cssxsh.mirai.tool.KFCFactory
      
      fun main() {
          prepareEnvironmentForDebugRun()
      
          Services.register(
              EncryptService.Factory::class.qualifiedName!!,
              KFCFactory::class.qualifiedName!!,
          ) {
              KFCFactory(File("..."))
          }
      
          val bot = DebugRunHelper.newBot(...)
      }
      

      添加运行配置

      IDEA 点击 Edit Configurations,添加运行配置

      9a152ff0-ee2a-4627-bd37-01731aea546c-image.png

      bc3fd953-563c-481f-910d-7c9d8fed03dd-image.png

      注意 classpath of module 选择 mirai.mirai-core.jvmTest ,main class 为 RunMirai.kt 的类名。

      保存之后直接运行即可。

      b4b408d0-581e-4759-bbdb-8d1c8eeb9a9a-image.png

      注意:若准备提交 Pull Request,请注意不要提交 mirai-core/build.gradle.kts 的修改,我们只是临时修改构建配置,目的是登录测试。

      发布在 技术交流板块
      StageGuard
      StageGuard
    • RE: 求助:请检查 magic-signer-guide by http://127.0.0.1:8888 的可用性

      @cssxsh

      发布在 使用交流
      StageGuard
      StageGuard
    • RE: 【每日沙雕图】沙雕小别墅

      QQ_Image_1683632462591.jpg

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: 发现一个野生插件,很想使用

      插件太旧了,建议:

      1. 联系作者更新 mirai 依赖。
      2. 尝试学习迁移并自己编译(迁移方法在楼上)
      发布在 使用交流
      StageGuard
      StageGuard
    • RE: 无法连接到 mirai。请检查 mirai-api-http 是否启动,地址与端口是否正确。

      你没有看到 mirai console 的 1 plugins enabled 吗,你根本没有安装 mirai-api-http 插件

      发布在 HTTP API和第三方SDK
      StageGuard
      StageGuard
    • RE: 查询 谁@我

      @202543782 https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/BuiltInCommands.md#permissioncommand
      在问任何问题之前最好完整阅读用户手册,以免引起不必要的麻烦

      发布在 插件发布
      StageGuard
      StageGuard
    • RE: console 插件接单

      顶顶,已接一单

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: console 插件接单

      顶顶

      发布在 摸鱼区
      StageGuard
      StageGuard
    • RE: 该如何理解PremiteeID里的群权限

      表示被授予权限的某个或者某类对象
      https://github.com/mamoe/mirai/blob/dev/mirai-console/docs/Permissions.md#字符串表示

      发布在 使用交流
      StageGuard
      StageGuard
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 1 / 7