mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-25 15:00:09 +08:00
Add UserOrBot.nameCardOrNick
This commit is contained in:
parent
146433d56f
commit
daa7453d73
@ -490,6 +490,7 @@ public abstract interface class net/mamoe/mirai/contact/NormalMember : net/mamoe
|
||||
|
||||
public final class net/mamoe/mirai/contact/NormalMemberKt {
|
||||
public static final fun getNameCardOrNick (Lnet/mamoe/mirai/contact/User;)Ljava/lang/String;
|
||||
public static final fun getNameCardOrNick (Lnet/mamoe/mirai/contact/UserOrBot;)Ljava/lang/String;
|
||||
public static final fun isMuted (Lnet/mamoe/mirai/contact/NormalMember;)Z
|
||||
public static final fun mute-8Mi8wO0 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final synthetic fun mute-fcu0wV4 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
@ -490,6 +490,7 @@ public abstract interface class net/mamoe/mirai/contact/NormalMember : net/mamoe
|
||||
|
||||
public final class net/mamoe/mirai/contact/NormalMemberKt {
|
||||
public static final fun getNameCardOrNick (Lnet/mamoe/mirai/contact/User;)Ljava/lang/String;
|
||||
public static final fun getNameCardOrNick (Lnet/mamoe/mirai/contact/UserOrBot;)Ljava/lang/String;
|
||||
public static final fun isMuted (Lnet/mamoe/mirai/contact/NormalMember;)Z
|
||||
public static final fun mute-8Mi8wO0 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final synthetic fun mute-fcu0wV4 (Lnet/mamoe/mirai/contact/NormalMember;DLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
@ -141,10 +141,7 @@ public interface NormalMember : Member {
|
||||
|
||||
/**
|
||||
* 获取非空群名片或昵称.
|
||||
*
|
||||
* @return 当 [User] 为 [Member] 时返回 [Member.nameCardOrNick]
|
||||
*
|
||||
* 否则返回 [Member.nick]
|
||||
* @return 当 [User] 为 [NormalMember] 时返回 [Member.nameCardOrNick], 否则返回 [Member.nick]
|
||||
*/
|
||||
public val User.nameCardOrNick: String
|
||||
get() = when (this) {
|
||||
@ -152,6 +149,17 @@ public val User.nameCardOrNick: String
|
||||
else -> this.nick
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取非空群名片或昵称.
|
||||
* @return 当 [UserOrBot] 为 [NormalMember] 时返回 [Member.nameCardOrNick], 否则返回 [Member.nick]
|
||||
* @since 2.6
|
||||
*/
|
||||
public val UserOrBot.nameCardOrNick: String
|
||||
get() = when (this) {
|
||||
is NormalMember -> this.nameCardOrNick
|
||||
else -> this.nick
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断群成员是否处于禁言状态.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user