mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-16 19:22:31 +08:00
Add migration helpers for OfflineMessageSource.Kind
This commit is contained in:
parent
056c9722dc
commit
0e19197361
@ -28,6 +28,7 @@ import net.mamoe.mirai.message.data.MessageSource.Key.isAboutGroup
|
||||
import net.mamoe.mirai.message.data.MessageSource.Key.isAboutTemp
|
||||
import net.mamoe.mirai.message.data.MessageSource.Key.quote
|
||||
import net.mamoe.mirai.utils.LazyProperty
|
||||
import net.mamoe.mirai.utils.PlannedRemoval
|
||||
import net.mamoe.mirai.utils.safeCast
|
||||
|
||||
/**
|
||||
@ -145,7 +146,8 @@ public sealed class MessageSource : Message, MessageMetadata, ConstrainSingle {
|
||||
/**
|
||||
* 返回 `"[mirai:source:${ids.contentToString()},${internalIds.contentToString()}]"`
|
||||
*/
|
||||
public final override fun toString(): String = "[mirai:source:${ids.contentToString()},${internalIds.contentToString()}]"
|
||||
public final override fun toString(): String =
|
||||
"[mirai:source:${ids.contentToString()},${internalIds.contentToString()}]"
|
||||
|
||||
public companion object Key : AbstractMessageKey<MessageSource>({ it.safeCast() }) {
|
||||
/**
|
||||
@ -397,6 +399,13 @@ public abstract class OfflineMessageSource : MessageSource() {
|
||||
* 消息种类
|
||||
*/
|
||||
public abstract val kind: MessageSourceKind
|
||||
|
||||
@PlannedRemoval("2.0-M2")
|
||||
@Deprecated(
|
||||
"Use MessageSourceKind",
|
||||
ReplaceWith("MessageSourceKind", "net.mamoe.mirai.message.data.MessageSourceKind")
|
||||
)
|
||||
private enum class Kind
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
Loading…
Reference in New Issue
Block a user