更新到v0.1.1

修复 未查询到数据时提示异常问题
修复 获取玩家头像未显示双层皮肤问题
This commit is contained in:
2022-02-12 20:10:29 +08:00
parent 5113868a79
commit 1902e922a3
4 changed files with 15 additions and 6 deletions

View File

@ -3,11 +3,11 @@ plugins {
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
id("net.mamoe.mirai-console") version "2.9.2"
id("net.mamoe.mirai-console") version "2.10.0"
}
group = "top.jie65535"
version = "0.1.0"
version = "0.1.1"
repositories {
maven("https://maven.aliyun.com/repository/public")

View File

@ -76,8 +76,17 @@ object JMSCommand : CompositeCommand(
}
private suspend fun CommandSender.sendImage(data: ByteArray) {
data.toExternalResource().use {
subject?.sendImage(it)
try {
if (data.isEmpty()) {
subject?.sendMessage("未查询到数据")
return
}
data.toExternalResource().use {
subject?.sendImage(it)
}
} catch (e: Throwable) {
subject?.sendMessage(String(data))
}
}
}

View File

@ -9,7 +9,7 @@ object JMinecraftSkin : KotlinPlugin(
JvmPluginDescription(
id = "top.jie65535.mirai-console-jms-plugin",
name = "J Minecraft Skin",
version = "0.1.0",
version = "0.1.1",
) {
author("jie65535")
info("MC皮肤查询插件")

View File

@ -11,7 +11,7 @@ object MinecraftSkinService {
* 获取头像
*/
fun getAvatars(uuid: String)
= HttpUtil.get("https://crafatar.com/avatars/$uuid")
= HttpUtil.get("https://crafatar.com/avatars/$uuid?overlay")
/**
* 获取玩家头模型渲染图