Skip to content

Commit

Permalink
[OneBot] Fixed Notify of OneBotGroupFile.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan04 committed Mar 4, 2024
1 parent 46fc168 commit ace6945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Lagrange.OneBot/Core/Entity/Notify/OneBotGroupFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Lagrange.OneBot.Core.Entity.Notify;

[Serializable]
public class OneBotGroupFile(uint selfId, uint userId, OneBotFileInfo fileInfo) : OneBotNotify(selfId, "group_upload")
public class OneBotGroupFile(uint selfId, uint groupId, uint userId, OneBotFileInfo fileInfo) : OneBotNotify(selfId, "group_upload")
{
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
[JsonPropertyName("user_id")] public uint UserId { get; set; }
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;

[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;

[JsonPropertyName("file")] public OneBotFileInfo Info { get; set; } = fileInfo;
}
Expand Down
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Notify/NotifyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void RegisterEvents()
if (@event.Chain.GetEntity<FileEntity>() is { FileId: { } id } file)
{
var fileInfo = new OneBotFileInfo(id, file.FileName, (ulong)file.FileSize);
await service.SendJsonAsync(new OneBotGroupFile(bot.BotUin, @event.Chain.FriendUin, fileInfo));
await service.SendJsonAsync(new OneBotGroupFile(bot.BotUin, @event.Chain.GroupUin ?? 0, @event.Chain.FriendUin, fileInfo));
}
};

Expand Down

0 comments on commit ace6945

Please sign in to comment.