From 537fad6df4b1072509137e440e96c334bcdaf6f2 Mon Sep 17 00:00:00 2001 From: Colter23 <13864833022@163.com> Date: Sun, 27 Aug 2023 16:25:21 +0800 Subject: [PATCH] update --- build.gradle.kts | 4 ++-- .../top/colter/mirai/plugin/bilibili/BiliBiliDynamic.kt | 2 +- .../colter/mirai/plugin/bilibili/command/DynamicCommand.kt | 2 ++ .../kotlin/top/colter/mirai/plugin/bilibili/data/Dynamic.kt | 6 +++--- .../colter/mirai/plugin/bilibili/service/DynamicService.kt | 6 ++++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f598827..0f25386 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,12 +3,12 @@ plugins { kotlin("jvm") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion - id("net.mamoe.mirai-console") version "2.14.0" + id("net.mamoe.mirai-console") version "2.15.0" id("me.him188.maven-central-publish") version "1.0.0-dev-3" } group = "top.colter" -version = "3.2.10" +version = "3.2.11" repositories { mavenLocal() diff --git a/src/main/kotlin/top/colter/mirai/plugin/bilibili/BiliBiliDynamic.kt b/src/main/kotlin/top/colter/mirai/plugin/bilibili/BiliBiliDynamic.kt index 0dd57c2..9aee07b 100644 --- a/src/main/kotlin/top/colter/mirai/plugin/bilibili/BiliBiliDynamic.kt +++ b/src/main/kotlin/top/colter/mirai/plugin/bilibili/BiliBiliDynamic.kt @@ -24,7 +24,7 @@ object BiliBiliDynamic : KotlinPlugin( JvmPluginDescription( id = "top.colter.bilibili-dynamic-mirai-plugin", name = "BiliBili Dynamic", - version = "3.2.10", + version = "3.2.11", ) { author("Colter") dependsOn("xyz.cssxsh.mirai.plugin.mirai-skia-plugin", ">= 1.1.0") diff --git a/src/main/kotlin/top/colter/mirai/plugin/bilibili/command/DynamicCommand.kt b/src/main/kotlin/top/colter/mirai/plugin/bilibili/command/DynamicCommand.kt index d01eb9f..4d53596 100644 --- a/src/main/kotlin/top/colter/mirai/plugin/bilibili/command/DynamicCommand.kt +++ b/src/main/kotlin/top/colter/mirai/plugin/bilibili/command/DynamicCommand.kt @@ -71,6 +71,8 @@ object DynamicCommand : CompositeCommand( } } catch (e: NumberFormatException) { sendMessage("ID错误 [$id]") + } catch (e: Exception) { + sendMessage("订阅失败 ${e.message}") } } } diff --git a/src/main/kotlin/top/colter/mirai/plugin/bilibili/data/Dynamic.kt b/src/main/kotlin/top/colter/mirai/plugin/bilibili/data/Dynamic.kt index 188c5d0..963ac80 100644 --- a/src/main/kotlin/top/colter/mirai/plugin/bilibili/data/Dynamic.kt +++ b/src/main/kotlin/top/colter/mirai/plugin/bilibili/data/Dynamic.kt @@ -442,13 +442,13 @@ data class ModuleDynamic( @SerialName("state") val state: Int, @SerialName("is_upower_active") - val active: Boolean, + val active: Boolean? = null, @SerialName("desc") val desc: Desc, @SerialName("button") - val button: Button, + val button: Button? = null, @SerialName("jump_url") - val jumpUrl: String, + val jumpUrl: String? = null, ) /** diff --git a/src/main/kotlin/top/colter/mirai/plugin/bilibili/service/DynamicService.kt b/src/main/kotlin/top/colter/mirai/plugin/bilibili/service/DynamicService.kt index 9d6df3b..a00c4b3 100644 --- a/src/main/kotlin/top/colter/mirai/plugin/bilibili/service/DynamicService.kt +++ b/src/main/kotlin/top/colter/mirai/plugin/bilibili/service/DynamicService.kt @@ -65,8 +65,10 @@ object DynamicService { if (!dynamic.containsKey(uid)) { val m = followUser(uid) if (m != null) return@withLock m - val u = client.userInfo(uid) - dynamic[uid] = SubData(u?.name!!) + val un = if (uid == 11783021L) { + "哔哩哔哩番剧出差" + } else client.userInfo(uid)?.name!! + dynamic[uid] = SubData(un) } //dynamic[uid]?.contacts?.apply {