mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Fix wraparound on paginated lists
This commit is contained in:
parent
fe22ba4f32
commit
cf263af44c
1 changed files with 3 additions and 0 deletions
|
|
@ -83,6 +83,9 @@ namespace PluralKit.Bot {
|
|||
if (reaction.Emote.Name == "\u23E9") currentPage = pageCount - 1; // >>
|
||||
if (reaction.Emote.Name == Emojis.Error) break; // X
|
||||
|
||||
// C#'s % operator is dumb and wrong, so we fix negative numbers
|
||||
if (currentPage < 0) currentPage += pageCount;
|
||||
|
||||
// If we can, remove the user's reaction (so they can press again quickly)
|
||||
if (await ctx.HasPermission(ChannelPermission.ManageMessages) && reaction.User.IsSpecified) await msg.RemoveReactionAsync(reaction.Emote, reaction.User.Value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue