mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-07 01:20:12 +08:00
Make At.<primary constructor> public and deprecated old _lowLevelConstructAtInstance
This commit is contained in:
parent
4b2385572d
commit
115fc63890
@ -15,6 +15,7 @@ import net.mamoe.mirai.contact.Group
|
||||
import net.mamoe.mirai.data.*
|
||||
import net.mamoe.mirai.utils.MiraiExperimentalApi
|
||||
import net.mamoe.mirai.utils.WeakRef
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
|
||||
/**
|
||||
* 标示这个 API 是低级的 API.
|
||||
@ -26,7 +27,7 @@ import net.mamoe.mirai.utils.WeakRef
|
||||
@MiraiExperimentalApi
|
||||
@RequiresOptIn
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
||||
@Target(CLASS, TYPE, FUNCTION, PROPERTY, CONSTRUCTOR)
|
||||
public annotation class LowLevelApi
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@ import net.mamoe.mirai.LowLevelApi
|
||||
import net.mamoe.mirai.contact.Member
|
||||
import net.mamoe.mirai.contact.nameCardOrNick
|
||||
import net.mamoe.mirai.message.code.CodableMessage
|
||||
import net.mamoe.mirai.utils.PlannedRemoval
|
||||
|
||||
|
||||
/**
|
||||
@ -30,9 +31,7 @@ import net.mamoe.mirai.message.code.CodableMessage
|
||||
* @see AtAll 全体成员
|
||||
*/
|
||||
@Serializable
|
||||
public data class At
|
||||
@Suppress("DataClassPrivateConstructor")
|
||||
private constructor(
|
||||
public data class At @LowLevelApi constructor(
|
||||
public val target: Long,
|
||||
/**
|
||||
* "@群员名片"
|
||||
@ -59,6 +58,8 @@ private constructor(
|
||||
@Suppress("FunctionName")
|
||||
@JvmStatic
|
||||
@LowLevelApi
|
||||
@Deprecated("Use constructor instead", ReplaceWith("At(target, display)", "net.mamoe.mirai.message.data.At"))
|
||||
@PlannedRemoval("2.0-M2")
|
||||
public fun _lowLevelConstructAtInstance(target: Long, display: String): At = At(target, display)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user