From 27601d3b4f3933f2532071d4b301b37aec8ea180 Mon Sep 17 00:00:00 2001 From: Linwenxuan Date: Fri, 1 Mar 2024 16:46:15 +0800 Subject: [PATCH] [OneBot] Add invitor_id to the OneBotGroupRequest --- Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs | 2 ++ Lagrange.OneBot/Core/Notify/NotifyService.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs b/Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs index e2c500480..81e4236ea 100644 --- a/Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs +++ b/Lagrange.OneBot/Core/Entity/Notify/OneBotGroupRequest.cs @@ -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; } } \ No newline at end of file diff --git a/Lagrange.OneBot/Core/Notify/NotifyService.cs b/Lagrange.OneBot/Core/Notify/NotifyService.cs index cec5d4bfd..5f5e5e0a0 100644 --- a/Lagrange.OneBot/Core/Notify/NotifyService.cs +++ b/Lagrange.OneBot/Core/Notify/NotifyService.cs @@ -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 }); } };