ygimenez / Pagination-Utils

A collection of methods to make message pagination with JDA easier.
GNU Lesser General Public License v2.1
27 stars 7 forks source link

Feature request: Add paginate without skipAmount, but keeping Predicate<User> #4

Closed HeyBanditoz closed 3 years ago

HeyBanditoz commented 3 years ago

Is your feature request related to a problem? Please describe. There exists

com.github.ygimenez.method.Pages#paginate(net.dv8tion.jda.api.entities.Message, java.util.List<com.github.ygimenez.model.Page>, int, java.util.concurrent.TimeUnit, int, java.util.function.Predicate<net.dv8tion.jda.api.entities.User>)

for adding pagination to a message with a Predicate, however, no such method exists to add pagination with a Predicate without a skipAmount

Describe the solution you'd like Something like

com.github.ygimenez.method.Pages#paginate(net.dv8tion.jda.api.entities.Message, java.util.List<com.github.ygimenez.model.Page>, int, java.util.concurrent.TimeUnit, java.util.function.Predicate<net.dv8tion.jda.api.entities.User>)

the same thing (without) the int skipAmount parameter, but keeping the Predicate parameter.

Describe alternatives you've considered Setting skipAmount in the method call to zero, which results in the buttons existing still, or setting it to -1, which causes it to traverse backwards, eventually hitting an indexOutOfBoundsException.

Additional context N/A

ygimenez commented 3 years ago

Thanks for the suggestion, It'll be added in the next release.

ygimenez commented 3 years ago

Implemented in release 1.3.0