fix(onebot): distinguish group invitation identities
Expose joining members, inviters and request operators separately. Preserve existing notice fields and report unavailable invitation identities explicitly. Refs #643
This commit is contained in:
20 files changed
+853
-63
No files matched your search
@@ -161,6 +161,7 @@ import type {
|
||||
GroupFileUrl,
|
||||
GroupMessageHistory,
|
||||
GroupNoticeInfo,
|
||||
GroupSystemMessage,
|
||||
GroupTodoListItem,
|
||||
LoginInfo,
|
||||
MediaInfo,
|
||||
@@ -242,7 +243,7 @@ export interface SnowLumaActionMap {
|
||||
get_group_member_list: { params: GetGroupMemberListParams; data: JsonObject[] };
|
||||
get_group_member_info: { params: GetGroupMemberInfoParams; data: JsonObject };
|
||||
get_group_honor_info: { params: GetGroupHonorInfoParams; data: JsonValue };
|
||||
get_group_system_msg: { params: GetGroupSystemMsgParams; data: JsonObject[] };
|
||||
get_group_system_msg: { params: GetGroupSystemMsgParams; data: GroupSystemMessage[] };
|
||||
set_group_kick: { params: SetGroupKickParams; data: EmptyData };
|
||||
set_group_kick_members: { params: SetGroupKickMembersParams; data: EmptyData };
|
||||
set_group_ban: { params: SetGroupBanParams; data: EmptyData };
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { JsonObject, JsonValue } from './json.js';
|
||||
import type { GroupIdentityStatus } from './results.js';
|
||||
|
||||
export interface OneBotBaseEvent extends JsonObject {
|
||||
time: number;
|
||||
@@ -52,6 +53,17 @@ export interface OneBotNoticeEvent extends OneBotBaseEvent {
|
||||
notice_type: string;
|
||||
}
|
||||
|
||||
export interface OneBotGroupIncreaseEvent extends OneBotNoticeEvent {
|
||||
notice_type: 'group_increase';
|
||||
sub_type: 'approve' | 'invite';
|
||||
group_id: number;
|
||||
user_id: number;
|
||||
operator_id: number;
|
||||
/** Independent inviter, when QQ supplies one. Zero does not prove absence. */
|
||||
invitor_id?: number;
|
||||
invitor_status?: GroupIdentityStatus;
|
||||
}
|
||||
|
||||
export type BotStatusSubType = 'online' | 'offline';
|
||||
|
||||
/** Bridge session edge. Not KickNT `bot_offline`. */
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
import type { OneBotPrivateMessageEvent } from './events.js';
|
||||
import type { JsonArray, JsonObject, JsonValue } from './json.js';
|
||||
|
||||
/** Unknown includes missing information; it does not mean that no such person exists. */
|
||||
export type GroupIdentityStatus = 'known' | 'unknown';
|
||||
|
||||
export interface GroupSystemMessage extends JsonObject {
|
||||
group_id: number;
|
||||
group_name: string;
|
||||
request_id: number;
|
||||
requester_uin: number;
|
||||
requester_nick: string;
|
||||
invitor_uin: number;
|
||||
invitor_nick: string;
|
||||
message: string;
|
||||
checked: boolean;
|
||||
flag: string;
|
||||
/** Always the applicant or invitee; unlike requester_uin on self invitations. */
|
||||
target_uin?: number;
|
||||
target_nick?: string;
|
||||
target_status?: GroupIdentityStatus;
|
||||
invitor_status?: GroupIdentityStatus;
|
||||
/** The person who handled the request, not necessarily the inviter. */
|
||||
operator_uin?: number;
|
||||
operator_nick?: string;
|
||||
operator_status?: GroupIdentityStatus;
|
||||
}
|
||||
|
||||
export interface QzoneCommentReply {
|
||||
uin: number;
|
||||
name: string;
|
||||
|
||||
Reference in new issue
Block a user