feat(onebot): report the invited account on group invite events
request.group.invite already identified the inviter. The event now also reports the invited account when QQ provides it. Closes #394
This commit is contained in:
12 files changed
+181
-3
No files matched your search
@@ -16,11 +16,13 @@ export function convertFriendRequest(ctx: ConverterContext, event: FriendRequest
|
||||
}
|
||||
|
||||
export function convertGroupInvite(ctx: ConverterContext, event: GroupInvite): JsonObject {
|
||||
const invitedId = event.invitedUin ?? 0;
|
||||
return request(ctx, event, {
|
||||
request_type: 'group',
|
||||
sub_type: event.subType || 'invite',
|
||||
group_id: event.groupId,
|
||||
user_id: event.fromUin,
|
||||
...(invitedId > 0 ? { invited_id: invitedId } : {}),
|
||||
comment: event.message,
|
||||
flag: event.flag,
|
||||
});
|
||||
|
||||
@@ -180,6 +180,10 @@ export class GroupRequestPoller {
|
||||
groupId: request.groupId,
|
||||
fromUin,
|
||||
fromUid,
|
||||
...(notifyType === 1 ? {
|
||||
invitedUin: request.targetUin,
|
||||
invitedUid: request.targetUid,
|
||||
} : {}),
|
||||
subType,
|
||||
message: request.comment,
|
||||
flag: formatGroupRequestFlag(inviteCardSequence === undefined ? request : {
|
||||
|
||||
Reference in new issue
Block a user