@llt12213 现在已经支持绑定服务器地址到群聊了
Under-estimate 发布的帖子
-
RE: McMotd - 以图片的形式获取Minecraft服务器信息(支持彩色文字、HTTP API)
@NNanfeng
在Ubuntu 20.04.2 LTS
上的测试结果表明,确实是没有安装字体的问题。McMotd需要字体来渲染图片,因此系统中没有安装字体时则会出错。以下为在Ubuntu上安装字体的方法:- 将一个中文字体文件(
*.ttf
或*.ttc
)复制到/usr/share/fonts
文件夹下。如果你的PC操作系统为Windows,推荐使用C:\Windows\Fonts
文件夹下的微软雅黑字体msyh.ttc
- 设置字体文件的权限:
chmod 644 <你的字体文件>
- 将一个中文字体文件(
-
RE: McMotd - 以图片的形式获取Minecraft服务器信息(支持彩色文字、HTTP API)
@NNanfeng 似乎是运行环境中没有安装字体,请提供运行mirai的操作系统信息和java版本信息以便进一步分析
-
McMotd - 以图片的形式获取Minecraft服务器信息(支持彩色文字、HTTP API)
获取MC服务器信息并以图片形式展示服务器图标、标题、延迟、玩家数量等信息。如下图所示:
- 目前仅支持Java版服务器
- 支持绘制玩家数量历史记录图表
- 支持HTTP API
- 支持IPv6服务器
详细命令用法见README。
-
RE: 为子项目配置mirai-core依赖时出现的问题
将子项目中
plugins { id 'idea' id 'java' } apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'com.github.johnrengelman.shadow'
改为
plugins { id 'org.jetbrains.kotlin.jvm' id 'com.github.johnrengelman.shadow' id 'idea' id 'java' }
更改之后没有作用。
尝试使用分离API和实现的方式,成功解决问题。
-
为子项目配置mirai-core依赖时出现的问题
项目结构如图所示:
InformationPanel
为主项目,依赖于子项目Dependency
,两个项目都依赖于mirai-core
主项目的build.gradle
配置:plugins { id 'org.jetbrains.kotlin.jvm' version '1.4.32' id 'com.github.johnrengelman.shadow' version '5.2.0' } group = 'InformationPanel' version = '1.0.0' repositories { maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } maven { url 'https://mirrors.huaweicloud.com/repository/maven' } mavenCentral() jcenter() } dependencies { api('net.mamoe:mirai-core:+') implementation 'com.alibaba:fastjson:+' implementation 'com.github.oshi:oshi-core:+' implementation 'org.reflections:reflections:+' implementation project(':Dependency') }
子项目的
build.gradle
配置:plugins { id 'idea' id 'java' } //这两个插件不能写在plugins中,否则gradle import会报错 apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'com.github.johnrengelman.shadow' repositories { maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://mirrors.huaweicloud.com/repository/maven' } mavenCentral() } dependencies { api('net.mamoe:mirai-core:+') implementation 'com.alibaba:fastjson:1.2.75' implementation 'org.slf4j:slf4j-simple:2.0.0-alpha1' implementation 'org.reflections:reflections:0.9.12' testImplementation('org.junit.jupiter:junit-jupiter:5.5.2') }
按照如上的配置,gradle import之后主项目的依赖配置正常,但子项目的classpath中缺少
mirai-core
依赖项。IntelliJ IDEA提供的修复选项Add library 'Gradle: ...' to classpath
执行后也没有效果。
尝试清除IntelliJ IDEA的缓存后重新导入无效,无视错误直接编译会编译失败,提示子项目中找不到mirai中各种类的定义。
若将子项目作为单独的项目打开,将build.gradle
中的kotlin.jvm
以及johnrengelman.shadow
插件写在plugin中并带上版本号,则依赖配置可以正常工作。
考虑到mirai配置项目依赖的文档中提到:注意,必须添加 Kotlin 插件才能正确获取 mirai 软件包。
可能是因为子项目中两个插件未写在plugin中,但若将其写在plugin中则会在gradle import时报错:
Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.4.32'] > Plugin request for plugin already on the classpath must not include a version
附加信息
IntelliJ IDEA 版本2020.1 Ultimate
,已安装Mirai Console插件版本2.6.1
mirai-core 版本(主项目)2.7-M1-dev-1
几个月之前这样的配置是可以正常工作的,今天重新打开这个项目时发现出现了此问题
-
PermitteeId中g类型的用法是什么
表示任何群对象. (不是指群成员, 而是指这个 '群')
所以说
g12345678
指的是群12345678中的所有消息还是...?g12345678
和m12345678.*
是一样的吗?:thinking_face: