From d414ce7ce73bf8f27541cf790cc429bb27f0c3dd Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 18 Dec 2020 21:10:24 +0800 Subject: [PATCH] Add migration helper for PokeMessage.type --- .../commonMain/kotlin/message/data/HummerMessage.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mirai-core-api/src/commonMain/kotlin/message/data/HummerMessage.kt b/mirai-core-api/src/commonMain/kotlin/message/data/HummerMessage.kt index 88b5c7585..e7f87c61f 100644 --- a/mirai-core-api/src/commonMain/kotlin/message/data/HummerMessage.kt +++ b/mirai-core-api/src/commonMain/kotlin/message/data/HummerMessage.kt @@ -17,6 +17,7 @@ import kotlinx.serialization.Contextual import kotlinx.serialization.Serializable import net.mamoe.mirai.message.code.CodableMessage import net.mamoe.mirai.message.data.VipFace.Kind +import net.mamoe.mirai.utils.PlannedRemoval import net.mamoe.mirai.utils.castOrNull import net.mamoe.mirai.utils.safeCast @@ -56,7 +57,14 @@ public data class PokeMessage internal constructor( public val id: Int ) : HummerMessage(), CodableMessage { @ExperimentalMessageKey - override val key: MessageKey get() = Key + override val key: MessageKey + get() = Key + + + @PlannedRemoval("2.0-M2") + @Deprecated("Use pokeType", ReplaceWith("pokeType"), DeprecationLevel.ERROR) + val type: Int + get() = pokeType public companion object Key : AbstractPolymorphicMessageKey(HummerMessage, { it.castOrNull() }) { @@ -206,7 +214,8 @@ public data class VipFace internal constructor( } @ExperimentalMessageKey - override val key: MessageKey get() = Key + override val key: MessageKey + get() = Key @Suppress("DEPRECATION_ERROR", "DEPRECATION", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") public companion object Key :