Skip to content

Releases: ygimenez/Pagination-Utils

Pagination Utils 4.1.0 - Let there be text

25 Oct 16:20
Compare
Choose a tag to compare

Added support for buttons containing either a text or emoji label, this affects both Pages.categorize and Pages.buttonize methods.
This release also unifies the finalizer task scheduling on a single pool, which allows cancelling previous tasks mapped to the same ID (for example timeout refreshers). This change should reduce resource usage by the library.

WARNING: The methods Pages.categorize and Pages.buttonize now use Mapping for button declaration instead of a regular Map. The class' methods are the same as a map mostly, so simply renaming should work for current usages.

Changelist:

  • Methods that accepted Map<Emoji, V> now use Mapping<V> instead, this is to allow Emote and String to be used simultaneously. Existing usages can be safely renamed to use Mapping as it shares the same methods as a Map (but does not implement it).
  • Tasks are now managed by TaskScheduler, preventing two concurrent tasks running for the same message.
  • EventHandler event methods now accept a String instead of generating an ID from a Message, existing usages must use EventHandler.getEventId to generate them manually.
  • Updated JDA version to 5.1.0.

Pagination Utils 4.0.6 - A little patch

18 Sep 13:16
Compare
Choose a tag to compare

Moved the feature onRemove (which was ran if an unknown message was found during event handling) to PaginatorBuilder. This feature was available for some versions already, but on a different class, this patch simply puts it where it was supposed to be.

Solved issues:

Changelist:

  • Moved onRemove getters and setters to PaginatorBuilder.
  • Fixed typos in javadocs

Pagination Utils 4.0.5b - Menus for everyone

14 Aug 19:00
Compare
Choose a tag to compare

Added support for SelectMenu value retrieval, and fixed the issue where buttons would refuse to work in ephemeral messages. To use SelectMenus with buttonization you must use ButtonizeHelper, or add the components afterwards, but remember to keep the original buttons else the library will clear the components.

It's also possible to retrieve the values from other messages, should you ever need to, this can be done through getDropdownValues() method in MessageHandler (can be found in Pages.getHandler()). To get the event's ID, use getEventId() method in the same class.

Changelist:

  • Renamed MessageHandler to EventHandler.
  • Added InteractionHook to the internal event handler, as you cannot retrieve ephemeral messages.
  • Added missing javadocs.

Pagination Utils 4.0.4 - Hotfix not found

13 Jun 12:49
Compare
Choose a tag to compare

EmbedClusters now no longer requires a pre-filled list, fixed some other small issues including Pages.categorize() not enabling previously selected buttons after switching to another category.

Changelist:

  • Removed EmbedCluster requiring a non-empty list of embeds.
  • Fixed Pages.categorize() not re-enabling non-selected buttons.
  • Updated JDA version to 5.0.0-beta.10.

Pagination Utils 4.0.3 - Multi-embed pages

19 May 14:14
Compare
Choose a tag to compare

Added support to multi-embed pages, as this now might be a desirable feature for multi-image embeds (see this), also updated JDA dependency to latest release.

WARNING: Constructors for Page and InteractPage are now protected, please use Page.of() and InteractPage.of() instead.

Changelist:

  • Added EmbedCluster class, which can have up to 10 embeds added to a single page.
  • Made Page and InteractPage constructors protected.
  • Updated JDA version to v5.0.0-beta.9.
  • Fixed typos in javadocs.

Pagination Utils 4.0.2b - Minor enhancement

05 May 16:57
Compare
Choose a tag to compare

Nothing major, just some needed improvement to buttonization accessibility.

Changelist:

  • ButtonWrapper now returns the Button that was clicked in Pages.buttonize().
  • Added @Nullable to getHook() and getButton() in ButtonWrapper to warn about possible nullability.
  • Pages.modifyButtons() no longer requires a non-null Page to be able to edit the buttons, also it no longer overwrites the components (no longer uses a Helper to supply the components).

Pagination Utils 4.0.1 - Electric Boogaloo

07 Mar 14:31
Compare
Choose a tag to compare

And here we are again, the long-waited release is finally here, with many performance improvements and full compatibility to JDA 5. The most notable improvement is that API calls were reduced to one per event (more in the case of reactions), reducing considerably the amount of requests sent to Discord during method calls (paginate, categorize, buttonize and lazyPaginate).
Another notable feature in this version is the addition of Helper classes (namely PaginateHelper, CategorizeHelper, ButtonizeHelper and LazyPaginateHelper) which allow reusage of configurations and easier configuration.

WARNING: This version had signature changes on some methods, making it incompatible with older versions, make sure to check your code after updating.

Solved issues:

Changelist:

  • Updated to JDA 5
  • Changed Page to use String instead of Message (MessageEmbeds unaffected)
  • Reduced API calls across all methods
  • Introduction of Helper classes
  • Optimized internal handling of Pages
  • Added handling for unmapped interactions (PUtilsConfig.setOnRemove())
  • Updated README

Pagination Utils 3.0.8 - Custom emotes hotfix 2

08 Mar 13:02
Compare
Choose a tag to compare

Fixed yet another custom emoji issue where categorization was the one affected now.

Solved issues:

Changelist:

  • Fixed categorization emoji issue
  • Split createSimplePaginator and setHandler into two signatures (one for JDA and one for ShardManager).

Pagination Utils 3.0.7 - Custom emotes hotfix

28 Feb 13:30
Compare
Choose a tag to compare

Fixed a weird behavior where pagination would ignore custom-added emotes when using reaction-based pagination.

Solved issues:

Changelist:

  • Now the events check Paginator's emote map before checking for default emotes
  • Added a condition to only update if the page has changed
  • Some minor codebase formatting

Pagination Utils 3.0.6 - Events hotfix

20 Jan 14:40
Compare
Choose a tag to compare

Added more info to most event-related exceptions to help finding where is the issue, as well as added a check to prevent trying to process user-created buttons and reactions.

Solved issues:

Changelist:

  • Added source info to event-related exceptions (Guild, channel and message IDs)
  • Added a guard before event processing (only allows events that exist in the Map)
  • Unified both types of buttons event processing into a single method
  • Updated JDA to latest LTS version