Releases: ygimenez/Pagination-Utils
Pagination Utils 4.1.0 - Let there be text
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 useMapping<V>
instead, this is to allow Emote and String to be used simultaneously. Existing usages can be safely renamed to useMapping
as it shares the same methods as aMap
(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 useEventHandler.getEventId
to generate them manually.- Updated JDA version to 5.1.0.
Pagination Utils 4.0.6 - A little patch
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:
- Issue #49
Changelist:
- Moved
onRemove
getters and setters toPaginatorBuilder
. - Fixed typos in javadocs
Pagination Utils 4.0.5b - Menus for everyone
Added support for SelectMenu
value retrieval, and fixed the issue where buttons would refuse to work in ephemeral messages. To use SelectMenu
s 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
toEventHandler
. - Added
InteractionHook
to the internal event handler, as you cannot retrieve ephemeral messages. - Added missing javadocs.
Pagination Utils 4.0.4 - Hotfix not found
EmbedCluster
s 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
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
andInteractPage
constructors protected. - Updated JDA version to v5.0.0-beta.9.
- Fixed typos in javadocs.
Pagination Utils 4.0.2b - Minor enhancement
Nothing major, just some needed improvement to buttonization accessibility.
Changelist:
- ButtonWrapper now returns the Button that was clicked in
Pages.buttonize()
. - Added
@Nullable
togetHook()
andgetButton()
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
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
Fixed yet another custom emoji issue where categorization was the one affected now.
Solved issues:
- Issue #41
Changelist:
- Fixed categorization emoji issue
- Split
createSimplePaginator
andsetHandler
into two signatures (one forJDA
and one forShardManager
).
Pagination Utils 3.0.7 - Custom emotes hotfix
Fixed a weird behavior where pagination would ignore custom-added emotes when using reaction-based pagination.
Solved issues:
- Issue #40
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
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:
- Issue #37
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