add FriendAddEvent

This commit is contained in:
Fripine
2024-04-24 17:34:22 +08:00
committed by GitHub
parent 84894a73e1
commit 32213be7a7

View File

@@ -446,6 +446,16 @@ export class OB11Constructor {
}
}
static async FriendAddEvent(msg: RawMessage): Promise<OB11FriendAddNoticeEvent | undefined> {
if (msg.chatType !== ChatType.friend) {
return;
}
if (msg.peerUin&&msg.peerUid) {
const event = new OB11FriendAddNoticeEvent(parseInt(msg.peerUin));
return event;
}
}
static friend(friend: User): OB11User {
return {
user_id: parseInt(friend.uin),