Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] 增加群待办相关事件 #2723

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from
85 changes: 85 additions & 0 deletions mirai-core-api/compatibility-validation/android/api/android.api
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ public abstract interface class net/mamoe/mirai/contact/Group : kotlinx/coroutin
public fun getOrFail (J)Lnet/mamoe/mirai/contact/NormalMember;
public abstract fun getOwner ()Lnet/mamoe/mirai/contact/NormalMember;
public abstract fun getSettings ()Lnet/mamoe/mirai/contact/GroupSettings;
public abstract fun getTodo ()Lnet/mamoe/mirai/contact/todo/GroupTodo;
public fun quit ()Z
public abstract fun quit (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun sendMessage (Ljava/lang/String;)Lnet/mamoe/mirai/message/MessageReceipt;
Expand Down Expand Up @@ -1210,6 +1211,47 @@ public abstract interface class net/mamoe/mirai/contact/roaming/RoamingSupported
public abstract fun getRoamingMessages ()Lnet/mamoe/mirai/contact/roaming/RoamingMessages;
}

public abstract interface class net/mamoe/mirai/contact/todo/GroupTodo {
public fun close (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun close (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun close (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun close (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun complete (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun complete (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun complete (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun complete (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun current ()Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;
public abstract fun current (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun recall (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun recall (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun recall (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun recall (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun set (Lnet/mamoe/mirai/message/data/MessageSource;)Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;
public abstract fun set (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun status ()Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public abstract fun status (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class net/mamoe/mirai/contact/todo/GroupTodoRecord {
public final fun getGroup ()Lnet/mamoe/mirai/contact/Group;
public final fun getMsgRandom ()J
public final fun getMsgSeq ()J
public final fun getOperator ()Lnet/mamoe/mirai/contact/NormalMember;
public final fun getOperatorId ()J
public final fun getOperatorNick ()Ljava/lang/String;
public final fun getOperatorTime ()I
public final fun getTitle ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/contact/todo/GroupTodoStatus : java/lang/Enum {
public static final field CLOSED Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static final field COMPLETED Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static final field NONE Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static fun valueOf (Ljava/lang/String;)Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static fun values ()[Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
}

public abstract interface class net/mamoe/mirai/data/FriendInfo : net/mamoe/mirai/data/UserInfo {
public abstract fun getFriendGroupId ()I
public abstract fun getNick ()Ljava/lang/String;
Expand Down Expand Up @@ -2570,6 +2612,18 @@ public final class net/mamoe/mirai/event/events/MemberCardChangeEvent : net/mamo
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberCompleteTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public abstract class net/mamoe/mirai/event/events/MemberHonorChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public abstract fun getHonorType ()I
public abstract fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
}

public final class net/mamoe/mirai/event/events/MemberHonorChangeEvent$Achieve : net/mamoe/mirai/event/events/MemberHonorChangeEvent {
public synthetic fun <init> (Lnet/mamoe/mirai/contact/NormalMember;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lnet/mamoe/mirai/contact/NormalMember;
Expand Down Expand Up @@ -2714,6 +2768,14 @@ public final class net/mamoe/mirai/event/events/MemberLeaveEvent$Quit : net/mamo
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberLuckyWordEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;Ljava/util/List;)V
public final fun getImages ()Ljava/util/List;
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberMuteEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Lnet/mamoe/mirai/contact/Member;
public final fun component2 ()I
Expand Down Expand Up @@ -2743,6 +2805,20 @@ public final class net/mamoe/mirai/event/events/MemberPermissionChangeEvent : ne
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberRecallTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberSetTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberSpecialTitleChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
Expand All @@ -2761,6 +2837,15 @@ public final class net/mamoe/mirai/event/events/MemberSpecialTitleChangeEvent :
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberTemperatureTitleChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;ILjava/lang/String;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public final fun getTemperature ()I
public final fun getTitle ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberUnmuteEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Lnet/mamoe/mirai/contact/Member;
public final fun component2 ()Lnet/mamoe/mirai/contact/Member;
Expand Down
85 changes: 85 additions & 0 deletions mirai-core-api/compatibility-validation/jvm/api/jvm.api
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ public abstract interface class net/mamoe/mirai/contact/Group : kotlinx/coroutin
public fun getOrFail (J)Lnet/mamoe/mirai/contact/NormalMember;
public abstract fun getOwner ()Lnet/mamoe/mirai/contact/NormalMember;
public abstract fun getSettings ()Lnet/mamoe/mirai/contact/GroupSettings;
public abstract fun getTodo ()Lnet/mamoe/mirai/contact/todo/GroupTodo;
public fun quit ()Z
public abstract fun quit (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun sendMessage (Ljava/lang/String;)Lnet/mamoe/mirai/message/MessageReceipt;
Expand Down Expand Up @@ -1210,6 +1211,47 @@ public abstract interface class net/mamoe/mirai/contact/roaming/RoamingSupported
public abstract fun getRoamingMessages ()Lnet/mamoe/mirai/contact/roaming/RoamingMessages;
}

public abstract interface class net/mamoe/mirai/contact/todo/GroupTodo {
public fun close (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun close (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun close (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun close (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun complete (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun complete (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun complete (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun complete (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun current ()Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;
public abstract fun current (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun recall (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;)V
public abstract fun recall (Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun recall (Lnet/mamoe/mirai/message/data/MessageSource;)V
public abstract fun recall (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun set (Lnet/mamoe/mirai/message/data/MessageSource;)Lnet/mamoe/mirai/contact/todo/GroupTodoRecord;
public abstract fun set (Lnet/mamoe/mirai/message/data/MessageSource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun status ()Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public abstract fun status (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class net/mamoe/mirai/contact/todo/GroupTodoRecord {
public final fun getGroup ()Lnet/mamoe/mirai/contact/Group;
public final fun getMsgRandom ()J
public final fun getMsgSeq ()J
public final fun getOperator ()Lnet/mamoe/mirai/contact/NormalMember;
public final fun getOperatorId ()J
public final fun getOperatorNick ()Ljava/lang/String;
public final fun getOperatorTime ()I
public final fun getTitle ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/contact/todo/GroupTodoStatus : java/lang/Enum {
public static final field CLOSED Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static final field COMPLETED Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static final field NONE Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static fun valueOf (Ljava/lang/String;)Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
public static fun values ()[Lnet/mamoe/mirai/contact/todo/GroupTodoStatus;
}

public abstract interface class net/mamoe/mirai/data/FriendInfo : net/mamoe/mirai/data/UserInfo {
public abstract fun getFriendGroupId ()I
public abstract fun getNick ()Ljava/lang/String;
Expand Down Expand Up @@ -2570,6 +2612,18 @@ public final class net/mamoe/mirai/event/events/MemberCardChangeEvent : net/mamo
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberCompleteTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public abstract class net/mamoe/mirai/event/events/MemberHonorChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public abstract fun getHonorType ()I
public abstract fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
}

public final class net/mamoe/mirai/event/events/MemberHonorChangeEvent$Achieve : net/mamoe/mirai/event/events/MemberHonorChangeEvent {
public synthetic fun <init> (Lnet/mamoe/mirai/contact/NormalMember;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lnet/mamoe/mirai/contact/NormalMember;
Expand Down Expand Up @@ -2714,6 +2768,14 @@ public final class net/mamoe/mirai/event/events/MemberLeaveEvent$Quit : net/mamo
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberLuckyWordEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;Ljava/util/List;)V
public final fun getImages ()Ljava/util/List;
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberMuteEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Lnet/mamoe/mirai/contact/Member;
public final fun component2 ()I
Expand Down Expand Up @@ -2743,6 +2805,20 @@ public final class net/mamoe/mirai/event/events/MemberPermissionChangeEvent : ne
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberRecallTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberSetTodoEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberSpecialTitleChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
Expand All @@ -2761,6 +2837,15 @@ public final class net/mamoe/mirai/event/events/MemberSpecialTitleChangeEvent :
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberTemperatureTitleChangeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotPassiveEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/internal/network/Packet {
public fun <init> (Lnet/mamoe/mirai/contact/NormalMember;ILjava/lang/String;)V
public synthetic fun getMember ()Lnet/mamoe/mirai/contact/Member;
public fun getMember ()Lnet/mamoe/mirai/contact/NormalMember;
public final fun getTemperature ()I
public final fun getTitle ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/MemberUnmuteEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/GroupMemberEvent, net/mamoe/mirai/event/events/GroupMemberInfoChangeEvent, net/mamoe/mirai/event/events/GroupOperableEvent, net/mamoe/mirai/internal/network/Packet {
public final fun component1 ()Lnet/mamoe/mirai/contact/Member;
public final fun component2 ()Lnet/mamoe/mirai/contact/Member;
Expand Down
8 changes: 8 additions & 0 deletions mirai-core-api/src/commonMain/kotlin/contact/Group.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import net.mamoe.mirai.contact.announcement.Announcements
import net.mamoe.mirai.contact.essence.Essences
import net.mamoe.mirai.contact.file.RemoteFiles
import net.mamoe.mirai.contact.roaming.RoamingSupported
import net.mamoe.mirai.contact.todo.GroupTodo
import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.*
Expand Down Expand Up @@ -237,6 +238,13 @@ public interface Group : Contact, CoroutineScope, FileSupported, AudioSupported,
*/
public val essences: Essences

/**
* 群待办相关功能接口
*
* @since 2.16
*/
public val todo: GroupTodo

public companion object {
/**
* 将一条消息设置为群精华消息, 需要管理员或群主权限.
Expand Down
Loading