Browse Source

fix: Cached message emoji cleanup at MESSAGE_REACTION_REMOVE_EMOJI (#1835)

MESSAGE_REACTION_REMOVE_EMOJI events were triggering REST calls by invoking `RemoveAllReactionsForEmoteAsync` instead of `RemoveReactionsForEmote`, the latter being to handle cached message state cleanup.
tags/2.4.0
moiph GitHub 4 years ago
parent
commit
8afef8245c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 1
- 1
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -1482,7 +1482,7 @@ namespace Discord.WebSocket
var cacheable = new Cacheable<IUserMessage, ulong>(cachedMsg, data.MessageId, isCached, async () => await channel.GetMessageAsync(data.MessageId).ConfigureAwait(false) as IUserMessage);
var emote = data.Emoji.ToIEmote();

cachedMsg?.RemoveAllReactionsForEmoteAsync(emote);
cachedMsg?.RemoveReactionsForEmote(emote);

await TimedInvokeAsync(_reactionsRemovedForEmoteEvent, nameof(ReactionsRemovedForEmote), cacheable, channel, emote).ConfigureAwait(false);
}


Loading…
Cancel
Save