mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: 加群邀请上报
fix: 加群和加好友post_type字段改为request
This commit is contained in:
src
@@ -289,6 +289,16 @@ function onLoad() {
|
||||
groupRequestEvent.flag = notify.seq;
|
||||
postOB11Event(groupRequestEvent);
|
||||
}
|
||||
else if(notify.type == GroupNotifyTypes.INVITE_ME){
|
||||
groupNotifies[notify.seq] = notify;
|
||||
let groupInviteEvent = new OB11GroupRequestEvent();
|
||||
groupInviteEvent.group_id = parseInt(notify.group.groupCode);
|
||||
let user_id = (await NTQQApi.getUserDetailInfo(notify.user2.uid))?.uin
|
||||
groupInviteEvent.user_id = parseInt(user_id);
|
||||
groupInviteEvent.sub_type = "invite";
|
||||
groupInviteEvent.flag = notify.seq;
|
||||
postOB11Event(groupInviteEvent);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
log("解析群通知失败", e.stack);
|
||||
|
@@ -300,6 +300,7 @@ export interface RawMessage {
|
||||
}
|
||||
|
||||
export enum GroupNotifyTypes {
|
||||
INVITE_ME = 1,
|
||||
INVITED_JOIN = 4, // 有人接受了邀请入群
|
||||
JOIN_REQUEST = 7,
|
||||
ADMIN_SET = 8,
|
||||
|
@@ -3,7 +3,7 @@ import {EventType} from "../OB11BaseEvent";
|
||||
|
||||
|
||||
export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
|
||||
// post_type = EventType.REQUEST
|
||||
post_type = EventType.REQUEST
|
||||
user_id: number;
|
||||
request_type: "friend" = "friend";
|
||||
comment: string;
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import {OB11GroupNoticeEvent} from "../notice/OB11GroupNoticeEvent";
|
||||
import {EventType} from "../OB11BaseEvent";
|
||||
|
||||
|
||||
export class OB11GroupRequestEvent extends OB11GroupNoticeEvent{
|
||||
post_type = EventType.REQUEST;
|
||||
request_type: "group" = "group";
|
||||
sub_type: "add" | "invite" = "add";
|
||||
comment: string;
|
||||
|
Reference in New Issue
Block a user