From 5f117e19bb9c6ec4efcd5a375e1a9a6800e74dc0 Mon Sep 17 00:00:00 2001 From: quin lynch Date: Sun, 19 Dec 2021 23:51:52 -0400 Subject: [PATCH] fix: guild scheduled events update --- src/Discord.Net.WebSocket/DiscordSocketClient.cs | 2 +- src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index b107fbbea..8a42442be 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -2642,7 +2642,7 @@ namespace Discord.WebSocket return; } - var before = guild.GetEvent(data.Id); + var before = guild.GetEvent(data.Id)?.Clone(); var beforeCacheable = new Cacheable(before, data.Id, before != null, () => Task.FromResult((SocketGuildEvent)null)); diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs index 6974c0498..df619e4ca 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs @@ -196,6 +196,8 @@ namespace Discord.WebSocket public IAsyncEnumerable> GetUsersAsync(ulong fromUserId, Direction dir, int limit = DiscordConfig.MaxGuildEventUsersPerBatch, RequestOptions options = null) => GuildHelper.GetEventUsersAsync(Discord, this, fromUserId, dir, limit, options); + internal SocketGuildEvent Clone() => MemberwiseClone() as SocketGuildEvent; + #region IGuildScheduledEvent ///