MiraiForum

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

    cssxsh 创建的主题

    • cssxsh

      FixProtocolVersion 临时性协议修复插件(code=45, code=235)
      项目发布 • • cssxsh

      5
      0
      赞同
      5
      帖子
      3219
      浏览

      cssxsh

      https://github.com/cssxsh/fix-protocol-version

      给我好好看日志阿,可恶

      1.9.0+ 正式接入第三方签名服务,以解决 code=45

      PS: 对封号/冻结导致的 code=45 是无效的

      mirai-core 也是可以用的,SPI 加载的问题已修复
      为了保险可用使用 KFCFactory.install() 手动注册

    • cssxsh

      写了点示例代码
      开发交流 • • cssxsh

      3
      1
      赞同
      3
      帖子
      482
      浏览

      cssxsh

      https://github.com/cssxsh/mirai-example

      Mirai 示例代码

      如果没有你想学习或参照的示例,可以到 issues 表述需求

    • cssxsh

      关于签名服务
      官方公告 • • cssxsh

      26
      0
      赞同
      26
      帖子
      17388
      浏览

      cssxsh

      为什么需要签名服务

      登录和发消息时需要对数据包进行签名验证
      无法通过验证就会出现 code=45 或者 他人无法看到机器人发送的消息
      并且签名服务和登录协议版本需要匹配,否则签名无效

      Mirai 对签名服务支持

      Mirai 不会提供内置的签名服务,但提供了接入第三方服务的接口

      需要注意的是,Mirai 不对签名服务作任何的推荐,
      并且是否使用及使用何种服务,由用户自行决定。

      对签名服务支持是在 2.15.0 正式引入的

      如何使用第三方签名服务 https://github.com/cssxsh/fix-protocol-version
      已经封装好的第三方对接插件,只需修改其配置文件即可
    • cssxsh

      W/stderr: ERROR StatusLogger Log4j2 could not find a logging implementation.
      使用交流 • • cssxsh

      1
      0
      赞同
      1
      帖子
      178
      浏览

      cssxsh

      0000-00-00 00:00:00 W/stderr: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

      mirai-console 出现这个的解决方法

      在 plugin-shared-libraries/libraries.txt 中加入两行

      org.apache.logging.log4j:log4j-api:2.20.0 org.apache.logging.log4j:log4j-to-slf4j:2.20.0
    • cssxsh

      登录小技巧
      使用交流 • • cssxsh

      2
      0
      赞同
      2
      帖子
      386
      浏览

      cssxsh

      如果你为你的 bot 配置了自动登录

      那么 当你手动登录的时候将会载入自动登录的配置作为默认参数
      也就是说不需要输入密码和协议也能执行登录指令
      login 123456

      如下指令可以关闭自动登录但保留配置
      /autoLogin setConfig 12345 enable false

      如下指令可以调整登录指令
      /autoLogin setConfig 123456 protocol ANDROID_PAD

    • cssxsh

      unidbg-fetch-qsign 1.1.3 使用方法
      使用交流 • • cssxsh

      25
      2
      赞同
      25
      帖子
      6548
      浏览

      cssxsh

      unidbg-fetch-qsign 1.1.3 后正式支持多个 android_id (Bot) 实例

      故 fix-protocol-version 1.9.0+ 将其正式接入
      https://github.com/cssxsh/fix-protocol-version/releases/tag/v1.9.3

      使用流程

      下载
      到 https://github.com/fuqiuluo/unidbg-fetch-qsign/releases/tag/1.1.3
      下载 unidbg-fetch-qsign-1.1.3.zip

      解压全部文件

      unidbg-fetch-qsign-1.1.3\ unidbg-fetch-qsign-1.1.3\bin unidbg-fetch-qsign-1.1.3\txlib ....

      txlib 下有两个子文件夹 8.9.63 / 8.9.68
      子文件夹下各自都有有 config.json,是对应的配置文件
      里面有关于端口的配置,端口默认是 8080,
      有冲突或者其他需要可自行修改(mirai-api-http 的默认端口也是8080 所以可能有冲突)

      在 unidbg-fetch-qsign-1.1.3 下 (不要进入bin)
      执行命令(协议版本 8.9.63)
      Linux:
      bin/unidbg-fetch-qsign --basePath=txlib/8.9.63
      Windows
      bin\unidbg-fetch-qsign.bat --basePath=txlib/8.9.63

      启动完成时最后会有如下日志 (8080是上面提到的端口)
      INFO ktor.application - Responding at http://127.0.0.1:8080

    • cssxsh

      协议问题汇报
      官方公告 • • cssxsh

      151
      1
      赞同
      151
      帖子
      27573
      浏览

      cssxsh

      请按照以下格式提交你遇到的问题

      不要截图
      不要截图
      不要截图

      日志文件在 logs 文件夹,自行翻阅提取信息

      不符合本贴主题 及 格式不对 或者 必要信息不足 的回复将会被删除

      mirai 版本
      例如下面日志里的 2.15.0-dev-98 ===============================[ Mirai console 2.15.0-dev-98 ]================================ __ __ __ __ ______ __ | \ / \ \ | \/ \ | \ | ▓▓\ / ▓▓\▓▓ ______ ______ \▓▓ ▓▓▓▓▓▓\ ______ _______ _______ ______ | ▓▓ ______ | ▓▓▓\ / ▓▓▓ \/ \ | \| \ ▓▓ \▓▓/ \| \ / \/ \| ▓▓/ \ | ▓▓▓▓\ ▓▓▓▓ ▓▓ ▓▓▓▓▓▓\ \▓▓▓▓▓▓\ ▓▓ ▓▓ | ▓▓▓▓▓▓\ ▓▓▓▓▓▓▓\ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓\ ▓▓ ▓▓▓▓▓▓\ | ▓▓\▓▓ ▓▓ ▓▓ ▓▓ ▓▓ \▓▓/ ▓▓ ▓▓ ▓▓ __| ▓▓ | ▓▓ ▓▓ | ▓▓\▓▓ \| ▓▓ | ▓▓ ▓▓ ▓▓ ▓▓ | ▓▓ \▓▓▓| ▓▓ ▓▓ ▓▓ | ▓▓▓▓▓▓▓ ▓▓ ▓▓__/ \ ▓▓__/ ▓▓ ▓▓ | ▓▓_\▓▓▓▓▓▓\ ▓▓__/ ▓▓ ▓▓ ▓▓▓▓▓▓▓▓ | ▓▓ \▓ | ▓▓ ▓▓ ▓▓ \▓▓ ▓▓ ▓▓\▓▓ ▓▓\▓▓ ▓▓ ▓▓ | ▓▓ ▓▓\▓▓ ▓▓ ▓▓\▓▓ \ \▓▓ \▓▓\▓▓\▓▓ \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓ \▓▓\▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓ \▓▓▓▓▓▓▓ 2023-06-15 11:05:20 I/main: Backend: version 2.15.0-dev-98, built on 2023-06-04 07:47:48. 2023-06-15 11:05:20 I/main: Frontend Terminal: version 2.15.0-dev-98, provided by Mamoe Technologies 协议版本信息
      例如下面日志 ,如果你没有安装 fix-protocol-version 可以不提交 2023-06-15 11:06:05 I/fix-protocol-version: 当前各协议版本日期: ANDROID_PHONE 8.9.58.11170 2023-05-19T11:35+08:00 ANDROID_PAD 8.8.88.7083 2022-03-23T11:01:55+08:00 ANDROID_WATCH 2.0.8 2019-06-03T20:25:31+08:00 IPAD 8.9.33.614 2021-12-31T11:36:26+08:00 MACOS 6.7.9 1970-01-01T08:00+08:00

      登录方式及使用的协议
      密码登录(ANDROID_PAD) / 扫码登录(ANDROID_WATCH)

      出现的问题
      举例:

      登录不上,日志为 xxxx 消息发不出去,消息类型为群聊/私聊
    • cssxsh

      一些碎碎念
      官方公告 • • cssxsh

      5
      7
      赞同
      5
      帖子
      2688
      浏览

      cssxsh

      本贴只接受补充建议,不接受提问

      Mirai 与 MCL

      MCL 是指 mirai-console-loader
      项目地址 https://github.com/iTXTech/mirai-console-loader

      Mirai 是指 mirai-core 或者 mirai-console
      项目地址 https://github.com/mamoe/mirai

      MCL 名字的意思是 mirai-console 启动器/加载器
      是用来管理 mirai-console 及 mirai-console插件的
      管理是指自动下载和版本检查之类的功能
      目前只支持从maven下载插件(本来有规划插件中心的,但是鸽了)

      提供 QQ Bot 功能的是 mirai-console ,MCL本身不提供功能
      而且两种本身相互独立,即 MCL 的版本不影响 mirai 的功能,反之 mirai 的版本不影响 MCL 的功能

      不要把 MCL 和 mirai 划等号,这会带来一些问题,
      比如提交 issue 时要求提交 mirai 版本,却有人提交了 MCL 的版本

      MCL 启动之后先出现的是 MCL 的日志,他会显示 mirai 及 mirai 插件的加载情况
      然后从 I/main: Starting mirai-console... 开始就是 mirai 的日志

      有时候 MCL 更新插件不及时
      原因是 MCL 默认使用 阿里云的 maven伪镜像, 伪镜像 更新不及时导致的

      MCL 的目录结构一般是这样的

      MCL ├───mcl.jar ├───mcl.cmd (WIN启动脚本) ├───mcl.sh (Linux/MACOS启动脚本) ├───bots (bot数据目录) │ ├───123456 │ │ ├───device.json │ │ ├───cache │ │ └───logs │ └───114514 │ ├───device.json │ ├───cache │ └───logs ├───config (配置目录) │ ├───Console │ │ ├───AutoLogin.yml │ │ ├───Command.yml │ │ ├───ExtensionSelector.yml │ │ ├───Logger.yml │ │ ├───PermissionService.yml │ │ └───PluginDependencies.yml │ └───net.mamoe.mirai-api-http │ └───setting.yml ├───data (数据目录) ├───libs (库目录,里面有mirai本体) ├───logs (日志目录,里面有日志文件) ├───plugins (插件目录) ├───plugin-libraries (插件库目录) └───plugin-shared-libraries (插件共享库目录) └───libraries.txt Mirai API HTTP

      项目地址 https://github.com/project-mirai/mirai-api-http

      提供HTTP API的中间件
      配置文件 setting.yml 所在请查阅上面的 MCL 文件树

      Mirai Native

      项目地址 https://github.com/iTXTech/mirai-native

      兼容酷Q插件的中间件, 需要 32位 Java
      但作者很忙没空管理

      2.14 之后 要正常使用要到
      https://github.com/cssxsh/mirai-native/suites/10378553865/artifacts/512083102
      里下载CI最新构建的版本
      CI 已过期

      备份👇
      mirai-native-2.0.1.mirai2.jar

      MiraiAndroid

      项目地址:https://github.com/mzdluo123/MiraiAndroid

      mirai-console 在 Android 中的实现
      作者已经不再维护此项目,无法保证可用性
      可用性自己试,别TM到处问能不能用,自己试一试不就知道了吗

      TxCaptchaHelper

      项目地址:https://github.com/mzdluo123/TxCaptchaHelper

      已不再维护
      c5934549-f8d7-4085-846e-748c34094fa6-image.png

      Mirai Compose

      项目地址:https://github.com/sonder-joker/mirai-compose

      mirai-console 的图形化实现
      作者已经不再维护此项目,无法保证可用性
      可用性自己试,别TM到处问能不能用,自己试一试不就知道了吗

    • cssxsh

      Mirai New Bing
      插件发布 • • cssxsh

      91
      4
      赞同
      91
      帖子
      15063
      浏览

      cssxsh

      Mirai New Bing

      基于 Mirai Console 的 New Bing Chat Bot 插件

      maven-central
      build

      效果

      screenshot.png

      更多配置请阅读 https://github.com/cssxsh/mirai-new-bing

      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue
      有问题请开 issue

      安装 MCL 指令安装

      请确认 mcl.jar 的版本是 2.1.0+
      ./mcl --update-package xyz.cssxsh.mirai:mirai-new-bing --channel maven-stable --type plugins

      手动安装 从 Releases 或者 Maven 下载 mirai2.jar 将其放入 plugins 文件夹中 爱发电
    • cssxsh

      基于 Stable Diffusion web UI 的 图片生成插件
      插件发布 • • cssxsh

      33
      1
      赞同
      33
      帖子
      5051
      浏览

      cssxsh

      Stable Diffusion Helper

      基于 Stable Diffusion web UI 的 图片生成插件

      maven-central
      MiraiForum

      使用前应该查阅的相关文档或项目

      User Manual Permission Command Stable Diffusion web UI Wiki

      本插件对接的是 Stable Diffusion web UI 的 REST API, 请在启动配置中开启选项,详情请自行查询 Stable Diffusion web UI Wiki

      使用 t2i

      以文生图
      权限ID: xyz.cssxsh.mirai.plugin.stable-diffusion-helper:txt2img
      例子:

      t2i steps=50 width=360 height=540 #德克萨斯 night, rain, wet t2i 123456 (8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),omertosa,1girl,(Kpop idol), (aegyo sal:1),cute,cityscape, night, rain, wet, professional lighting, photon mapping, radiosity, physically-based rendering, <lora:arknightsTexasThe_v10:1>, <lora:koreanDollLikeness_v10:0.5>,Black pantyhose 设置种子 t2i $seed 设置参数 key=value 使用Styles #xxx 第二行开始才会计入 prompt, 所以要两行以上才会触发指令

      支持的参数

      height Height 360 width Width 540 sampler_name Sampling method Euler a steps Sampling steps 32 batch_size Batch size 1 n_iter Batch count 1 cfg_scale CFG Scale 数字 restore_faces Restore faces false/true tiling Tiling false/true enable_hr Hires. fix false/true hr_second_pass_steps Hires Steps 0 denoising_strength Denoising strength 0.7 hr_upscaler Upscaler Latent hr_scale Upscale by 2.0 styles

      查看已经载入的 Styles
      权限ID: xyz.cssxsh.mirai.plugin.stable-diffusion-helper:styles
      例子:

      styles 风格

      Styles 是 Stable Diffusion web UI 自带的功能,用于快捷的填充 prompt 和 negative_prompt

      重载SD

      重载client.yml
      权限ID: xyz.cssxsh.mirai.plugin.stable-diffusion-helper:reload
      例子:

      重载SD 配置

      client.yml 基本配置

      base_url 基本网址 dns_over_https DNS timeout API超时时间 安装 MCL 指令安装

      请确认 mcl.jar 的版本是 2.1.0+
      ./mcl --update-package xyz.cssxsh:stable-diffusion-helper --channel maven-stable --type plugins

      手动安装 从 Releases 或者 Maven 下载 mirai2.jar 将其放入 plugins 文件夹中 爱发电

    • cssxsh

      网页截图插件
      插件发布 • • cssxsh

      15
      1
      赞同
      15
      帖子
      1892
      浏览

      cssxsh

      Web Screenshot Helper

      基于 Mirai Selenium Plugin 的 网页截图插件

      相关项目:
      Mirai Selenium Plugin 前置插件,用于 Selenium 框架的初始化

      权限ID xyz.cssxsh.mirai.plugin.web-screenshot-helper:*

      截图采用的是白名单模式
      你需要在 config/xyz.cssxsh.mirai.plugin.web-screenshot-helper/script 下创建建一个 $host.js 脚本
      例如 www.example.com.js , 脚本的内容决定截图的内容,一般取 return document.body; 即截取整个窗口
      如果想定制特殊的截图效果,比如去除广告,顶栏之类的。可以爱发电投食。

      关键词 截图 https://... 将会启用无头浏览器截取网页图片 安装 MCL 指令安装

      请确认 mcl.jar 的版本是 2.1.0+
      ./mcl --update-package xyz.cssxsh:web-screenshot-helper --channel maven-stable --type plugins

      手动安装 从 Releases 或者 Maven 下载 mirai2.jar 将其放入 plugins 文件夹中 爱发电

      afdian-小生化.jpg

    • cssxsh

      查询 谁@我
      插件发布 • • cssxsh

      33
      2
      赞同
      33
      帖子
      3788
      浏览

      cssxsh

      Mirai Hibernate Forward

      Mirai Hibernate Plugin 的 Forward 扩展

      相关项目:
      Mirai Hibernate Plugin 前置插件,用于 Hibernate ORM 框架的初始化

      权限ID xyz.cssxsh.mirai.plugin.mirai-hibernate-forward:*

      关键词 谁AT我 发送后将查找在群中@我的消息记录并处理为合并转发消息 安装 手动安装 从 Releases 下载 mirai2.jar 将其放入 plugins 文件夹中
    • cssxsh

      使用QQ截图无法显示的问题
      官方公告 • • cssxsh

      2
      2
      赞同
      2
      帖子
      850
      浏览

      cssxsh

      使用qq截图时经常会出现无法显示的问题
      原因是傻逼qq随机生成的文件名包含很多特殊符号

      例如👇
      ![B3Y%]3H6FPDJ3QI~%%_4@0F.png](/assets/uploads/files/1675753280156-b3y-3h6fpdj3qi-_4-0f.png)
      B3Y%]3H6FPDJ3QI~%%_4@0F

      你只需要手动改一下
      ![12345.png](/assets/uploads/files/1675753280156-b3y-3h6fpdj3qi-_4-0f.png)

      12345.png

    • cssxsh

      使用 Termux 简单的在安卓手机上 运行 Mirai
      技术交流板块 • • cssxsh

      7
      1
      赞同
      7
      帖子
      1279
      浏览

      cssxsh

      https://github.com/termux/termux-app

      一个在安卓手机上模拟 Linux 终端的软件

      首先 你需要一个 Android 7.0 以上版本的安卓手机
      (低于此版本的也可以, 但是我没空整一个低版本的教程)

      到
      https://f-droid.org/zh_Hans/packages/com.termux/
      下滑, 下载最新版本的构建, 现在是 com.termux_118.apk
      735abf05-3f2d-474d-bdec-cdeb4eb7d28b-image.png

      termux-change-repo
      先修改源保证后面的操作通畅
      第一个选项直接选择 OK (回车)
      第二个选项修改源为国内源
      选择 Mirrors in ChinaAll in China 选项 (上下切换后 使用空格选中) , 然后 OK (回车)

      pkg update
      因为是刚安装, 所以需要先拉取(查询)最新的包版本信息

      pkg install openjdk-17
      安装 Java 17

      java -version
      查看是否安装成功
      如果是, 就会出现 openjdk version "17-internal" ....

      pkg install wget
      安装 wget 需要 他来下载 MCL

      wget https://github.com/iTXTech/mirai-console-loader/releases/download/v2.1.2/mcl-2.1.2.zip
      下载最新版 MCL (现在是 2.1.2)

      unzip mcl-2.1.2.zip -d mcl
      解压到文件夹 mcl

      cd mcl
      进入下载文件夹,
      你可以使用 ls -l 查看一下文件夹里目前有那些文件

      chmod 777 mcl
      把启动脚本调整为可以运行

      ./mcl -u
      启动 MCL

    • cssxsh

      自动从 Github Release Latest 更新 JAR 插件
      使用交流 • • cssxsh

      1
      1
      赞同
      1
      帖子
      205
      浏览

      cssxsh

      我在我的 https://github.com/gnuf0rce/github-helper 插件 1.3.0中
      添加了启动时检查已安装插件对应的 Github Release Latest 更新并下载的功能

      比如 如果你安装了 bilibili-dynamic-mirai-plugin 他会 从 https://github.com/Colter23/bilibili-dynamic-mirai-plugin/releases/latest 获得最新版本信息,
      对比目前已安装的版本,如果发现是更新的版本,就下载
      并且会在正常退出时删除旧版插件

      默认的更新列表可以看
      https://github.com/gnuf0rce/github-helper/blob/main/src/main/kotlin/io/github/gnuf0rce/mirai/github/GitHubReleasePluginUpdater.kt

      可以通过编辑配置文件添加或者减少 更新的项目

      !!!请注意不要为同一插件同时使用此更新方法和MCL订阅配置,这可能会引起一些不必要的麻烦

    • cssxsh

      来点赞助或者插件定制(接单)
      摸鱼区 • • cssxsh

      15
      1
      赞同
      15
      帖子
      1426
      浏览

      cssxsh

      写过不少插件
      比较受欢迎的有
      https://github.com/cssxsh/pixiv-helper
      https://github.com/cssxsh/mirai-openai-plugin
      https://github.com/cssxsh/meme-helper
      https://github.com/cssxsh/mirai-administrator
      afdian-小生化.jpg

    • cssxsh

      OpenAI ChatBot 插件,已添加预设功能(为啥你们都想整猫娘)
      插件发布 • • cssxsh

      229
      6
      赞同
      229
      帖子
      52552
      浏览

      cssxsh

      目前
      实现了 OpenAI 中 提供的 Completion 和 Image Generation
      chat.jpg
      image.jpg
      completion.jpg
      bind.png

      详细文档请阅读 readme
      https://github.com/cssxsh/mirai-openai-plugin#readme

      有功能BUG或者建议请开 issue
      https://github.com/cssxsh/mirai-openai-plugin/issues

    • cssxsh

      Mirai Authenticator 加群验证插件
      插件发布 • • cssxsh

      5
      1
      赞同
      5
      帖子
      1566
      浏览

      cssxsh

      目前的功能有
      加群前 通过 lua 脚本验证请求,
      可以判断 进群答案或QQ等级之类的信息

      加群后 验证码验证:
      screenshot.jpg

      详情请看 https://github.com/cssxsh/mirai-authenticator#readme

    • cssxsh

      Mirai Economy Core 经济服务前置插件,支持多货币和事件系统
      插件发布 • economy 经济 • • cssxsh

      4
      2
      赞同
      4
      帖子
      1798
      浏览

      cssxsh

      Mirai Economy Core

      Mirai 经济服务前置插件

      maven-central
      Jpa Economy Service Test
      Codacy Badge

      目前需要 Mirai Hibernate Plugin 前置才能使用

      使用方法 请转进 README

    • cssxsh

      Mirai Native 尝试修复版本(mirai 2.13.0 不兼容)
      使用交流 • • cssxsh

      1
      1
      赞同
      1
      帖子
      320
      浏览

      cssxsh

      mirai-native cssxsh 编译修复版.zip

      将 编译时的 mirai 版本升级至 2.13.0,并且替换了 ktor 1 至 ktor 2

    • 1
    • 2
    • 3
    • 4
    • 1 / 4