Class Pages

java.lang.Object
com.github.ygimenez.method.Pages

public abstract class Pages extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    activate​(Paginator paginator)
    Set a Paginator object to handle incoming events.
    static void
    addReactions​(net.dv8tion.jda.api.entities.Message msg, boolean withSkip, boolean withGoto)
    Utility method to add navigation buttons.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, ButtonizeHelper helper)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, int time, TimeUnit unit)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean cancellable, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract, Consumer<net.dv8tion.jda.api.entities.Message> onCancel)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    buttonize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, Predicate<net.dv8tion.jda.api.entities.User> canInteract, Consumer<net.dv8tion.jda.api.entities.Message> onCancel)
    Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click.
    categorize​(net.dv8tion.jda.api.entities.Message msg, CategorizeHelper helper)
    Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages.
    categorize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons)
    Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages.
    categorize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, int time, TimeUnit unit)
    Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages.
    categorize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages.
    categorize​(net.dv8tion.jda.api.entities.Message msg, Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages.
    static void
    clearButtons​(net.dv8tion.jda.api.entities.Message msg)
    Utility method to clear all buttons of a message.
    static void
    clearReactions​(net.dv8tion.jda.api.entities.Message msg)
    Utility method to clear all reactions of a message.
    static void
    Removes current button handler, allowing another activate(Paginator) call.

    Using this method without activating beforehand will do nothing.
    static void
    finalizeEvent​(net.dv8tion.jda.api.entities.Message msg, Consumer<Void> callback)
    Utility method to clear all reactions of a message.
    Retrieves the library's MessageHandler object.
    static Paginator
    Retrieves the Paginator object used to activate this library.
    static boolean
    Checks whether this library has been activated or not.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, LazyPaginateHelper helper)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    lazyPaginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction.
    static void
    modifyButtons​(net.dv8tion.jda.api.entities.Message msg, Page p, Map<String,​Function<net.dv8tion.jda.api.interactions.components.buttons.Button,​net.dv8tion.jda.api.interactions.components.buttons.Button>> changes)
    Utility method for switching pages and/or modifying message buttons.
    paginate​(net.dv8tion.jda.api.entities.Message msg, PaginateHelper helper)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, boolean fastForward)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int skipAmount)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int skipAmount, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, boolean fastForward)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, boolean fastForward)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, int skipAmount, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    paginate​(net.dv8tion.jda.api.entities.Message msg, List<Page> pages, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract)
    Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
    static net.dv8tion.jda.api.entities.Message
    reloadMessage​(net.dv8tion.jda.api.entities.Message msg)
    Utility method for re-fetching a message.
    static <T> T
    subGet​(net.dv8tion.jda.api.requests.RestAction<T> future)
    Utility method for submitting a RestAction and awaiting its result.
    static <T> T
    subGet​(net.dv8tion.jda.api.requests.RestAction<T> future, T or)
    Utility method for submitting a RestAction and awaiting its result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • activate

      public static void activate(@NotNull Paginator paginator) throws InvalidHandlerException
      Set a Paginator object to handle incoming events. This is required only once unless you want to change which client is handling events.

      Before calling this method again, you must use deactivate() to remove current Paginator, else this method will throw AlreadyActivatedException.
      Parameters:
      paginator - The Paginator object.
      Throws:
      AlreadyActivatedException - Thrown if there's a handler already set.
      InvalidHandlerException - Thrown if the handler isn't either a JDA or ShardManager object.
    • deactivate

      public static void deactivate()
      Removes current button handler, allowing another activate(Paginator) call.

      Using this method without activating beforehand will do nothing.
    • isActivated

      public static boolean isActivated()
      Checks whether this library has been activated or not.
      Returns:
      The activation state of this library.
    • getPaginator

      public static Paginator getPaginator()
      Retrieves the Paginator object used to activate this library.
      Returns:
      The current Paginator object.
    • getHandler

      public static MessageHandler getHandler()
      Retrieves the library's MessageHandler object.
      Returns:
      The MessageHandler object.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, boolean fastForward) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, boolean fastForward) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int skipAmount) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int skipAmount, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int skipAmount, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, boolean fastForward) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull List<Page> pages, boolean useButtons, int time, TimeUnit unit, int skipAmount, boolean fastForward, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pages - The pages to be shown. The order of the List will define the order of the pages.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      skipAmount - The amount of pages to be skipped when clicking Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      fastForward - Whether the Emote.GOTO_FIRST and Emote.GOTO_LAST buttons should be shown.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • paginate

      public static ActionReference paginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull PaginateHelper helper) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will navigate through a given List of pages. This versions uses a helper class to aid customization and allow reusage of configurations.
      Parameters:
      msg - The Message sent which will be paginated.
      helper - A PaginateHelper holding desired pagination settings.
      Returns:
      An ActionReference pointing to this action. This is useful if you need to track whether an event is still being processed or was already removed (ie. garbage collected).
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or the page list is empty.
    • categorize

      public static ActionReference categorize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages. You may only specify one Page per button, adding another button with an existing unicode will overwrite the current button's Page.
      Parameters:
      msg - The Message sent which will be categorized.
      categories - The categories to be shown. The categories are defined by a Map containing emoji unicodes or emote ids as keys and Pages as values.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • categorize

      public static ActionReference categorize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, int time, TimeUnit unit) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages. You may only specify one Page per button, adding another button with an existing unicode will overwrite the current button's Page. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be categorized.
      categories - The categories to be shown. The categories are defined by a Map containing emoji unicodes or emote ids as keys and Pages as values.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • categorize

      public static ActionReference categorize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages. You may only specify one Page per button, adding another button with an existing unicode will overwrite the current button's Page.
      Parameters:
      msg - The Message sent which will be categorized.
      categories - The categories to be shown. The categories are defined by a Map containing emoji unicodes or emote ids as keys and Pages as values.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • categorize

      public static ActionReference categorize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​Page> categories, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages. You may only specify one Page per button, adding another button with an existing unicode will overwrite the current button's Page. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be categorized.
      categories - The categories to be shown. The categories are defined by a Map containing emoji unicodes or emote ids as keys and Pages as values.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • categorize

      public static ActionReference categorize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull CategorizeHelper helper) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds menu-like buttons to the specified Message/MessageEmbed which will browse through a given Map of pages. You may only specify one Page per button, adding another button with an existing unicode will overwrite the current button's Page. This versions uses a helper class to aid customization and allow reusage of configurations.
      Parameters:
      msg - The Message sent which will be categorized.
      helper - A CategorizeHelper holding desired categorization settings.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      showCancelButton - Should the Emote.CANCEL button be created automatically?
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, int time, TimeUnit unit) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable. You can specify the time in which the listener will automatically stop itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      showCancelButton - Should the Emote.CANCEL button be created automatically?
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      showCancelButton - Should the Emote.CANCEL button be created automatically?
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable. You can specify the time in which the listener will automatically stop itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      showCancelButton - Should the Emote.CANCEL button be created automatically?
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean showCancelButton, Predicate<net.dv8tion.jda.api.entities.User> canInteract, Consumer<net.dv8tion.jda.api.entities.Message> onCancel) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      showCancelButton - Should the Emote.CANCEL button be created automatically?
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      onCancel - Action to be run after the listener is removed.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull Map<net.dv8tion.jda.api.entities.emoji.Emoji,​ThrowingConsumer<ButtonWrapper>> buttons, boolean useButtons, boolean cancellable, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract, Consumer<net.dv8tion.jda.api.entities.Message> onCancel) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable. You can specify the time in which the listener will automatically stop itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be buttoned.
      buttons - The buttons to be shown. The buttons are defined by a Map containing emoji unicodes or emote ids as keys and ThrowingTriConsumer<Member, Message, InteractionHook> containing desired behavior as value.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      cancellable - Should the Emote.CANCEL button be created automatically?
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      onCancel - Action to be run after the listener is removed.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • buttonize

      public static ActionReference buttonize(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull ButtonizeHelper helper) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds buttons to the specified Message/MessageEmbed, with each executing a specific task on click. You may only specify one Runnable per button, adding another button with an existing unicode will overwrite the current button's Runnable. This versions uses a helper class to aid customization and allow reusage of configurations.
      Parameters:
      msg - The Message sent which will be buttoned.
      helper - A ButtonizeHelper holding desired buttonization settings.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit.
      Parameters:
      msg - The Message sent which will be paginated.
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit.
      Parameters:
      msg - The Message sent which will be paginated.
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening. for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit.
      Parameters:
      msg - The Message sent which will be paginated.
      pageCache - The List that'll hold previously visited pages (can be pre-filled or edited anytime).
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pageCache - The List that'll hold previously visited pages (can be pre-filled or edited anytime).
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit.
      Parameters:
      msg - The Message sent which will be paginated.
      pageCache - The List that'll hold previously visited pages (can be pre-filled or edited anytime).
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, List<Page> pageCache, @NotNull ThrowingFunction<Integer,​Page> pageLoader, boolean useButtons, int time, TimeUnit unit, Predicate<net.dv8tion.jda.api.entities.User> canInteract) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit. You can specify how long the listener will stay active before shutting down itself after a no-activity interval.
      Parameters:
      msg - The Message sent which will be paginated.
      pageCache - The List that'll hold previously visited pages (can be pre-filled or edited anytime).
      pageLoader - ThrowingFunction<Integer, Page> to generate the next page. If this returns null the method will treat it as last page, preventing unnecessary updates.
      useButtons - Whether to use interaction Button or reactions. Will fall back to false if the supplied Message was not sent by the bot.
      time - The time before the listener automatically stop listening for further events (recommended: 60).
      unit - The time's TimeUnit (recommended: TimeUnit.SECONDS).
      canInteract - Predicate to determine whether the User that pressed the button can interact with it or not.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • lazyPaginate

      public static ActionReference lazyPaginate(@NotNull net.dv8tion.jda.api.entities.Message msg, @NotNull LazyPaginateHelper helper) throws net.dv8tion.jda.api.exceptions.ErrorResponseException, net.dv8tion.jda.api.exceptions.InsufficientPermissionException
      Adds navigation buttons to the specified Message/MessageEmbed which will lazily load content by using supplied ThrowingFunction. For this reason, this pagination type cannot have skip nor fast-forward buttons given the unknown page limit. This versions uses a helper class to aid customization and allow reusage of configurations.
      Parameters:
      msg - The Message sent which will be paginated.
      helper - A LazyPaginateHelper holding desired lazy pagination settings.
      Returns:
      an ActionReference pointing to the newly created event, can be used for checking when it gets disposed of.
      Throws:
      net.dv8tion.jda.api.exceptions.ErrorResponseException - Thrown if the Message no longer exists or cannot be accessed when triggering a GenericMessageReactionEvent.
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - Thrown if this library cannot remove reactions due to lack of bot permission.
      InvalidStateException - Thrown if the library wasn't activated or first page cannot be generated.
    • reloadMessage

      public static net.dv8tion.jda.api.entities.Message reloadMessage(@NotNull net.dv8tion.jda.api.entities.Message msg)
      Utility method for re-fetching a message.
      Parameters:
      msg - The Message to be reloaded.
      Returns:
      The updated message instance.
    • subGet

      public static <T> T subGet(@NotNull net.dv8tion.jda.api.requests.RestAction<T> future)
      Utility method for submitting a RestAction and awaiting its result.
      Type Parameters:
      T - Return type for the RestAction.
      Parameters:
      future - The RestAction to be executed.
      Returns:
      The RestAction result, or null should it fail.
    • subGet

      public static <T> T subGet(@NotNull net.dv8tion.jda.api.requests.RestAction<T> future, @NotNull T or)
      Utility method for submitting a RestAction and awaiting its result.
      Type Parameters:
      T - Return type for the RestAction.
      Parameters:
      future - The RestAction to be executed.
      or - Fallback value to be returned should it fail.
      Returns:
      The RestAction result.
    • clearReactions

      public static void clearReactions(net.dv8tion.jda.api.entities.Message msg)
      Utility method to clear all reactions of a message.
      Parameters:
      msg - The Message to have reactions/buttons removed from.
    • clearButtons

      public static void clearButtons(net.dv8tion.jda.api.entities.Message msg)
      Utility method to clear all buttons of a message.
      Parameters:
      msg - The Message to have reactions/buttons removed from.
    • finalizeEvent

      public static void finalizeEvent(net.dv8tion.jda.api.entities.Message msg, Consumer<Void> callback)
      Utility method to clear all reactions of a message.
      Parameters:
      msg - The Message to have reactions removed from.
      callback - Action to be executed after removing reactions.
    • modifyButtons

      public static void modifyButtons(net.dv8tion.jda.api.entities.Message msg, @Nullable Page p, Map<String,​Function<net.dv8tion.jda.api.interactions.components.buttons.Button,​net.dv8tion.jda.api.interactions.components.buttons.Button>> changes)
      Utility method for switching pages and/or modifying message buttons.
      Parameters:
      msg - The Message holding the buttons.
      p - The current Page.
      changes - Map containing desired changes, indexed by Button ID.
    • addReactions

      public static void addReactions(net.dv8tion.jda.api.entities.Message msg, boolean withSkip, boolean withGoto)
      Utility method to add navigation buttons.
      Parameters:
      msg - The Message to have reactions removed from.
      withSkip - Whether to include Emote.SKIP_BACKWARD and Emote.SKIP_FORWARD buttons.
      withGoto - Whether to include Emote.GOTO_FIRST and Emote.GOTO_LAST buttons.