Remove redundant overrides for contacts

This commit is contained in:
Him188 2021-08-02 14:25:23 +08:00
parent a14531f696
commit 03a6596553
9 changed files with 14 additions and 64 deletions

View File

@ -19,13 +19,11 @@ public abstract interface class net/mamoe/mirai/Bot : kotlinx/coroutines/Corouti
public fun getGroup (J)Lnet/mamoe/mirai/contact/Group; public fun getGroup (J)Lnet/mamoe/mirai/contact/Group;
public fun getGroupOrFail (J)Lnet/mamoe/mirai/contact/Group; public fun getGroupOrFail (J)Lnet/mamoe/mirai/contact/Group;
public abstract fun getGroups ()Lnet/mamoe/mirai/contact/ContactList; public abstract fun getGroups ()Lnet/mamoe/mirai/contact/ContactList;
public abstract fun getId ()J
public static fun getInstance (J)Lnet/mamoe/mirai/Bot; public static fun getInstance (J)Lnet/mamoe/mirai/Bot;
public static fun getInstanceOrNull (J)Lnet/mamoe/mirai/Bot; public static fun getInstanceOrNull (J)Lnet/mamoe/mirai/Bot;
public static fun getInstances ()Ljava/util/List; public static fun getInstances ()Ljava/util/List;
public static fun getInstancesSequence ()Lkotlin/sequences/Sequence; public static fun getInstancesSequence ()Lkotlin/sequences/Sequence;
public abstract fun getLogger ()Lnet/mamoe/mirai/utils/MiraiLogger; public abstract fun getLogger ()Lnet/mamoe/mirai/utils/MiraiLogger;
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getOtherClients ()Lnet/mamoe/mirai/contact/ContactList; public abstract fun getOtherClients ()Lnet/mamoe/mirai/contact/ContactList;
public fun getStranger (J)Lnet/mamoe/mirai/contact/Stranger; public fun getStranger (J)Lnet/mamoe/mirai/contact/Stranger;
public fun getStrangerOrFail (J)Lnet/mamoe/mirai/contact/Stranger; public fun getStrangerOrFail (J)Lnet/mamoe/mirai/contact/Stranger;
@ -331,9 +329,6 @@ public abstract interface class net/mamoe/mirai/contact/FileSupported : net/mamo
public abstract interface class net/mamoe/mirai/contact/Friend : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User, net/mamoe/mirai/contact/VoiceSupported { public abstract interface class net/mamoe/mirai/contact/Friend : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User, net/mamoe/mirai/contact/VoiceSupported {
public fun delete ()V public fun delete ()V
public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getRemark ()Ljava/lang/String;
public fun nudge ()Lnet/mamoe/mirai/message/action/FriendNudge; public fun nudge ()Lnet/mamoe/mirai/message/action/FriendNudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
@ -526,8 +521,6 @@ public final class net/mamoe/mirai/contact/Platform$Companion {
public abstract interface class net/mamoe/mirai/contact/Stranger : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User { public abstract interface class net/mamoe/mirai/contact/Stranger : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User {
public fun delete ()V public fun delete ()V
public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge;
public fun nudge ()Lnet/mamoe/mirai/message/action/StrangerNudge; public fun nudge ()Lnet/mamoe/mirai/message/action/StrangerNudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
@ -544,7 +537,6 @@ public final class net/mamoe/mirai/contact/StrangerKt {
public abstract interface class net/mamoe/mirai/contact/User : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/Contact, net/mamoe/mirai/contact/UserOrBot { public abstract interface class net/mamoe/mirai/contact/User : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/Contact, net/mamoe/mirai/contact/UserOrBot {
public abstract fun getId ()J public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getRemark ()Ljava/lang/String; public abstract fun getRemark ()Ljava/lang/String;
public abstract fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public abstract fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
public fun queryProfile ()Lnet/mamoe/mirai/data/UserProfile; public fun queryProfile ()Lnet/mamoe/mirai/data/UserProfile;

View File

@ -19,13 +19,11 @@ public abstract interface class net/mamoe/mirai/Bot : kotlinx/coroutines/Corouti
public fun getGroup (J)Lnet/mamoe/mirai/contact/Group; public fun getGroup (J)Lnet/mamoe/mirai/contact/Group;
public fun getGroupOrFail (J)Lnet/mamoe/mirai/contact/Group; public fun getGroupOrFail (J)Lnet/mamoe/mirai/contact/Group;
public abstract fun getGroups ()Lnet/mamoe/mirai/contact/ContactList; public abstract fun getGroups ()Lnet/mamoe/mirai/contact/ContactList;
public abstract fun getId ()J
public static fun getInstance (J)Lnet/mamoe/mirai/Bot; public static fun getInstance (J)Lnet/mamoe/mirai/Bot;
public static fun getInstanceOrNull (J)Lnet/mamoe/mirai/Bot; public static fun getInstanceOrNull (J)Lnet/mamoe/mirai/Bot;
public static fun getInstances ()Ljava/util/List; public static fun getInstances ()Ljava/util/List;
public static fun getInstancesSequence ()Lkotlin/sequences/Sequence; public static fun getInstancesSequence ()Lkotlin/sequences/Sequence;
public abstract fun getLogger ()Lnet/mamoe/mirai/utils/MiraiLogger; public abstract fun getLogger ()Lnet/mamoe/mirai/utils/MiraiLogger;
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getOtherClients ()Lnet/mamoe/mirai/contact/ContactList; public abstract fun getOtherClients ()Lnet/mamoe/mirai/contact/ContactList;
public fun getStranger (J)Lnet/mamoe/mirai/contact/Stranger; public fun getStranger (J)Lnet/mamoe/mirai/contact/Stranger;
public fun getStrangerOrFail (J)Lnet/mamoe/mirai/contact/Stranger; public fun getStrangerOrFail (J)Lnet/mamoe/mirai/contact/Stranger;
@ -331,9 +329,6 @@ public abstract interface class net/mamoe/mirai/contact/FileSupported : net/mamo
public abstract interface class net/mamoe/mirai/contact/Friend : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User, net/mamoe/mirai/contact/VoiceSupported { public abstract interface class net/mamoe/mirai/contact/Friend : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User, net/mamoe/mirai/contact/VoiceSupported {
public fun delete ()V public fun delete ()V
public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getRemark ()Ljava/lang/String;
public fun nudge ()Lnet/mamoe/mirai/message/action/FriendNudge; public fun nudge ()Lnet/mamoe/mirai/message/action/FriendNudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
@ -526,8 +521,6 @@ public final class net/mamoe/mirai/contact/Platform$Companion {
public abstract interface class net/mamoe/mirai/contact/Stranger : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User { public abstract interface class net/mamoe/mirai/contact/Stranger : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/User {
public fun delete ()V public fun delete ()V
public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/Nudge;
public fun nudge ()Lnet/mamoe/mirai/message/action/StrangerNudge; public fun nudge ()Lnet/mamoe/mirai/message/action/StrangerNudge;
public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public synthetic fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
@ -544,7 +537,6 @@ public final class net/mamoe/mirai/contact/StrangerKt {
public abstract interface class net/mamoe/mirai/contact/User : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/Contact, net/mamoe/mirai/contact/UserOrBot { public abstract interface class net/mamoe/mirai/contact/User : kotlinx/coroutines/CoroutineScope, net/mamoe/mirai/contact/Contact, net/mamoe/mirai/contact/UserOrBot {
public abstract fun getId ()J public abstract fun getId ()J
public abstract fun getNick ()Ljava/lang/String;
public abstract fun getRemark ()Ljava/lang/String; public abstract fun getRemark ()Ljava/lang/String;
public abstract fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge; public abstract fun nudge ()Lnet/mamoe/mirai/message/action/UserNudge;
public fun queryProfile ()Lnet/mamoe/mirai/data/UserProfile; public fun queryProfile ()Lnet/mamoe/mirai/data/UserProfile;

View File

@ -49,21 +49,11 @@ public interface Bot : CoroutineScope, ContactOrBot, UserOrBot {
*/ */
public val configuration: BotConfiguration public val configuration: BotConfiguration
/**
* QQ 号码. 实际类型为 uint
*/
public override val id: Long
/** /**
* 返回 `this` * 返回 `this`
*/ */
public override val bot: Bot get() = this public override val bot: Bot get() = this
/**
* 昵称
*/
public override val nick: String
/** /**
* 日志记录器 * 日志记录器
*/ */

View File

@ -18,9 +18,13 @@ import net.mamoe.mirai.utils.ExternalResource
import net.mamoe.mirai.utils.NotStableForInheritance import net.mamoe.mirai.utils.NotStableForInheritance
/** /**
* 匿名 * 代表匿名群成员.
* *
* 代表匿名群成员 * 可通过 [anonymousId] 获取其识别属性. [AnonymousMember.id] 的值由服务器提供因此不可靠.
*
* 匿名群成员不支持发送私聊消息, 戳一戳, 上传图片.
*
* @see NormalMember
*/ */
@NotStableForInheritance @NotStableForInheritance
public interface AnonymousMember : Member { public interface AnonymousMember : Member {

View File

@ -35,21 +35,6 @@ import net.mamoe.mirai.utils.NotStableForInheritance
*/ */
@NotStableForInheritance @NotStableForInheritance
public interface Friend : User, CoroutineScope, VoiceSupported { public interface Friend : User, CoroutineScope, VoiceSupported {
/**
* QQ 号码
*/
public override val id: Long
/**
* 昵称
*/
public override val nick: String
/**
* 好友备注
*/
public override val remark: String
/** /**
* 向这个对象发送消息. * 向这个对象发送消息.
* *

View File

@ -28,10 +28,7 @@ import kotlin.time.ExperimentalTime
/** /**
* 代表一位普通的群成员. * 代表一位普通的群成员.
* *
* 群成员可能也是好友, 但他们在对象类型上不同. * @see AnonymousMember
* 群成员可以通过 [asFriend] 得到相关好友对象.
*
* @see
*/ */
@NotStableForInheritance @NotStableForInheritance
public interface NormalMember : Member { public interface NormalMember : Member {

View File

@ -43,17 +43,6 @@ import net.mamoe.mirai.utils.NotStableForInheritance
*/ */
@NotStableForInheritance @NotStableForInheritance
public interface Stranger : User, CoroutineScope { public interface Stranger : User, CoroutineScope {
/**
* QQ 号码
*/
public override val id: Long
/**
* 昵称
*/
public override val nick: String
/** /**
* 向这个对象发送消息. * 向这个对象发送消息.
* *

View File

@ -45,11 +45,6 @@ public interface User : Contact, UserOrBot, CoroutineScope {
*/ */
public override val id: Long public override val id: Long
/**
* 昵称
*/
public override val nick: String
/** /**
* 备注信息 * 备注信息
* *

View File

@ -22,7 +22,13 @@ import net.mamoe.mirai.utils.NotStableForInheritance
@NotStableForInheritance @NotStableForInheritance
public interface UserOrBot : ContactOrBot { public interface UserOrBot : ContactOrBot {
/** /**
* 昵称 * 获取昵称
*
* ### Kotlin 实用扩展:
*
* - [nameCardOrNick]: 若该用户是 [群成员][Member], 则优先返回其非空群名片, 否则返回 [nick].
* - [remarkOrNameCardOrNick]: [Bot] 对该用户有[备注][User.remark]则返回备注, 否则返回 [nameCardOrNick].
*
* @since 2.6 * @since 2.6
*/ */
public val nick: String public val nick: String