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.
This commit is contained in:
@@ -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 cacheable = new Cacheable<IUserMessage, ulong>(cachedMsg, data.MessageId, isCached, async () => await channel.GetMessageAsync(data.MessageId).ConfigureAwait(false) as IUserMessage);
|
||||||
var emote = data.Emoji.ToIEmote();
|
var emote = data.Emoji.ToIEmote();
|
||||||
|
|
||||||
cachedMsg?.RemoveAllReactionsForEmoteAsync(emote);
|
cachedMsg?.RemoveReactionsForEmote(emote);
|
||||||
|
|
||||||
await TimedInvokeAsync(_reactionsRemovedForEmoteEvent, nameof(ReactionsRemovedForEmote), cacheable, channel, emote).ConfigureAwait(false);
|
await TimedInvokeAsync(_reactionsRemovedForEmoteEvent, nameof(ReactionsRemovedForEmote), cacheable, channel, emote).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user