diff --git a/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs b/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs index aba4a2f1c1..a4cf7d7eb4 100644 --- a/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs +++ b/src/Discord.Net.WebSocket/API/Gateway/MessageDeleteBulkEvent.cs @@ -1,4 +1,4 @@ -#pragma warning disable CS1591 +#pragma warning disable CS1591 using Newtonsoft.Json; using System.Collections.Generic; @@ -9,6 +9,6 @@ internal class MessageDeleteBulkEvent [JsonProperty("channel_id")] public ulong ChannelId { get; set; } [JsonProperty("ids")] - public IEnumerable Ids { get; set; } + public ulong[] Ids { get; set; } } } diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 6443075925..166f36afea 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -1375,13 +1375,13 @@ await _gatewayLogger.WarningAsync("A bulk delete event has been received, but th return; } - var cacheableList = ImmutableArray>.Empty; + var cacheableList = new List>(data.Ids.Length); foreach (ulong id in data.Ids) { var msg = SocketChannelHelper.RemoveMessage(channel, this, id); bool isCached = msg != null; var cacheable = new Cacheable(msg, id, isCached, async () => await channel.GetMessageAsync(id).ConfigureAwait(false)); - cacheableList = cacheableList.Add(cacheable); + cacheableList.Add(cacheable); if (!ExclusiveBulkDelete ?? false) // this shouldn't happen, but we'll play it safe anyways await TimedInvokeAsync(_messageDeletedEvent, nameof(MessageDeleted), cacheable, channel).ConfigureAwait(false);