Skip to content

Commit

Permalink
[OneBot] Add invitor_id to the OneBotGroupRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan04 committed Mar 1, 2024
1 parent 7bcfdbb commit 27601d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public class OneBotGroupRequest(uint selfId, uint userId, uint groupId, string s
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;

[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;

[JsonPropertyName("invitor_id")] public uint InvitorId { get; set; }
}
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Notify/NotifyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void RegisterEvents()
if (requests?.FirstOrDefault(x => @event.GroupUin == x.GroupUin && @event.TargetUin == x.TargetMemberUin) is { } request)
{
string flag = $"{request.Sequence}-{request.GroupUin}-{(uint)request.EventType}";
await service.SendJsonAsync(new OneBotGroupRequest(bot.BotUin, @event.TargetUin, @event.GroupUin, "add", request.Comment, flag));
await service.SendJsonAsync(new OneBotGroupRequest(bot.BotUin, @event.TargetUin, @event.GroupUin, "add", request.Comment, flag) { InvitorId = @event.InvitorUin });
}
};

Expand Down

0 comments on commit 27601d3

Please sign in to comment.