feature: Add MESSAGE_REACTION_REMOVE_EMOJI and RemoveAllReactionsForEmoteAsync (#1544)

* Add event and method

* Simplify convert to IEmote
This commit is contained in:
Paulo
2020-06-15 01:04:34 -03:00
committed by GitHub
parent 42826df5e4
commit a89f0761f4
9 changed files with 103 additions and 0 deletions

View File

@@ -200,6 +200,10 @@ namespace Discord.WebSocket
{
_reactions.Clear();
}
internal void RemoveReactionsForEmote(IEmote emote)
{
_reactions.RemoveAll(x => x.Emote.Equals(emote));
}
/// <inheritdoc />
public Task AddReactionAsync(IEmote emote, RequestOptions options = null)
@@ -214,6 +218,9 @@ namespace Discord.WebSocket
public Task RemoveAllReactionsAsync(RequestOptions options = null)
=> MessageHelper.RemoveAllReactionsAsync(this, Discord, options);
/// <inheritdoc />
public Task RemoveAllReactionsForEmoteAsync(IEmote emote, RequestOptions options = null)
=> MessageHelper.RemoveAllReactionsForEmoteAsync(this, emote, Discord, options);
/// <inheritdoc />
public IAsyncEnumerable<IReadOnlyCollection<IUser>> GetReactionUsersAsync(IEmote emote, int limit, RequestOptions options = null)
=> MessageHelper.GetReactionUsersAsync(this, emote, limit, Discord, options);
}