mirror of
https://github.com/jie65535/mirai-console-jms-plugin.git
synced 2025-06-02 17:39:17 +08:00
fix: UUID API
This commit is contained in:
parent
adef471210
commit
0fcc1c0d54
@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "top.jie65535.mirai"
|
||||
version = "1.1.0"
|
||||
version = "1.1.1"
|
||||
|
||||
repositories {
|
||||
maven("https://maven.aliyun.com/repository/public")
|
||||
|
@ -9,7 +9,7 @@ object JMinecraftSkin : KotlinPlugin(
|
||||
JvmPluginDescription(
|
||||
id = "top.jie65535.mirai-console-jms-plugin",
|
||||
name = "J Minecraft Skin",
|
||||
version = "1.1.0",
|
||||
version = "1.1.1",
|
||||
) {
|
||||
author("jie65535")
|
||||
info("MC皮肤查询插件")
|
||||
|
@ -1,10 +1,7 @@
|
||||
package top.jie65535
|
||||
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonNull
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import kotlinx.serialization.json.*
|
||||
|
||||
/**
|
||||
* Minecraft UUID Service
|
||||
@ -25,7 +22,7 @@ object MinecraftUuidService {
|
||||
val retJson = HttpUtil.get("https://tenapi.cn/v2/mc/?uid=$username").decodeToString()
|
||||
val response = Json.decodeFromString<JsonObject>(retJson)
|
||||
if (response["code"]!!.jsonPrimitive.content == "200") {
|
||||
val elem = response["id"]!!.jsonPrimitive
|
||||
val elem = response["data"]!!.jsonObject["id"]!!.jsonPrimitive
|
||||
if (elem == JsonNull) throw Exception("Player UUID Not Found!")
|
||||
uuid = elem.content
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user