From b8c51c017bb87ebf4d1909158dc2262a552c5273 Mon Sep 17 00:00:00 2001 From: Paulo Date: Sat, 1 Jul 2017 05:23:23 -0300 Subject: [PATCH] Avoid false positives between Emotes with the same name --- src/Discord.Addons.Paginator/PaginationService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Discord.Addons.Paginator/PaginationService.cs b/src/Discord.Addons.Paginator/PaginationService.cs index a27abd3..9f71086 100644 --- a/src/Discord.Addons.Paginator/PaginationService.cs +++ b/src/Discord.Addons.Paginator/PaginationService.cs @@ -87,7 +87,7 @@ internal async Task OnReactionAdded(Cacheable messageParam, } await message.RemoveReactionAsync(reaction.Emote, reaction.User.Value); await WriteLog(Log.Debug($"Handled reaction {reaction.Emote} from user {reaction.UserId}")); - if (reaction.Emote.Name == page.Options.EmoteFirst.Name) + if (reaction.Emote.ToString() == page.Options.EmoteFirst.ToString()) { if (page.CurrentPage != 1) { @@ -95,7 +95,7 @@ internal async Task OnReactionAdded(Cacheable messageParam, await message.ModifyAsync(x => x.Embed = page.GetEmbed()); } } - else if (reaction.Emote.Name == page.Options.EmoteBack.Name) + else if (reaction.Emote.ToString() == page.Options.EmoteBack.ToString()) { if (page.CurrentPage != 1) { @@ -103,7 +103,7 @@ internal async Task OnReactionAdded(Cacheable messageParam, await message.ModifyAsync(x => x.Embed = page.GetEmbed()); } } - else if (reaction.Emote.Name == page.Options.EmoteNext.Name) + else if (reaction.Emote.ToString() == page.Options.EmoteNext.ToString()) { if (page.CurrentPage != page.Count) { @@ -111,7 +111,7 @@ internal async Task OnReactionAdded(Cacheable messageParam, await message.ModifyAsync(x => x.Embed = page.GetEmbed()); } } - else if (reaction.Emote.Name == page.Options.EmoteLast.Name) + else if (reaction.Emote.ToString() == page.Options.EmoteLast.ToString()) { if (page.CurrentPage != page.Count) { @@ -119,7 +119,7 @@ internal async Task OnReactionAdded(Cacheable messageParam, await message.ModifyAsync(x => x.Embed = page.GetEmbed()); } } - else if (reaction.Emote.Name == page.Options.EmoteStop.Name) + else if (reaction.Emote.ToString() == page.Options.EmoteStop.ToString()) { if (page.Options.EmoteStopAction == StopAction.DeleteMessage) await message.DeleteAsync();