PublicFollowUpPaginator

class PublicFollowUpPaginator(val pages: Pages, val chunkedPages: Int = 1, val owner: UserBehavior? = null, val timeoutSeconds: Long? = null, val keepEmbed: Boolean = true, val switchEmoji: ReactionEmoji = if (pages.groups.size == 2) EXPAND_EMOJI else SWITCH_EMOJI, val mutator: PageTransitionCallback? = null, locale: Locale? = null, val interaction: FollowupPermittingInteractionResponseBehavior) : BaseButtonPaginator

Class representing a button-based paginator that operates by creating and editing a follow-up message for the given public interaction response.

Parameters

interaction

Interaction response behaviour to work with.

Constructors

Link copied to clipboard
constructor(pages: Pages, chunkedPages: Int = 1, owner: UserBehavior? = null, timeoutSeconds: Long? = null, keepEmbed: Boolean = true, switchEmoji: ReactionEmoji = if (pages.groups.size == 2) EXPAND_EMOJI else SWITCH_EMOJI, mutator: PageTransitionCallback? = null, locale: Locale? = null, interaction: FollowupPermittingInteractionResponseBehavior)

Properties

Link copied to clipboard
open var active: Boolean

Whether this paginator is currently active and processing events.

Link copied to clipboard
open var allGroups: List<Key>

Set of all page groups.

Link copied to clipboard

Button builder representing the button that switches to the previous page.

Link copied to clipboard

Current instance of the bot.

Link copied to clipboard

Whether it's possible for us to have a row of group-switching buttons.

Link copied to clipboard
open val chunkedPages: Int = 1
Link copied to clipboard

ComponentContainer instance managing the buttons for this paginator.

Link copied to clipboard

Currently-displayed page group.

Link copied to clipboard

Currently-displayed page index.

Link copied to clipboard

Currently-displayed page object.

Link copied to clipboard
val defaultCheck: CheckWithCache<ComponentInteractionCreateEvent>

A button-oriented check function that matches based on the owner property.

Link copied to clipboard
var embedInteraction: PublicFollowupMessage?

Follow-up interaction to use for this paginator's embeds. Will be created by send.

Link copied to clipboard

Button builder representing the button that switches to the first page.

Link copied to clipboard

Group-specific buttons, if any.

Link copied to clipboard
val interaction: FollowupPermittingInteractionResponseBehavior
Link copied to clipboard
open val keepEmbed: Boolean = true
Link copied to clipboard
val kord: Kord

Kord instance, backing the ExtensibleBot.

Link copied to clipboard

Button builder representing the button that switches to the last page.

Link copied to clipboard
open val localeObj: Locale

Locale to use for translations.

Link copied to clipboard
Link copied to clipboard

Button builder representing the button that switches to the next page.

Link copied to clipboard
open val owner: UserBehavior? = null
Link copied to clipboard
open val pages: Pages
Link copied to clipboard

Scheduler used to schedule the paginator's timeout.

Link copied to clipboard

Button builder representing the button that switches between groups.

Link copied to clipboard
open val switchEmoji: ReactionEmoji
Link copied to clipboard
var task: Task?

Scheduler used to schedule the paginator's timeout.

Link copied to clipboard
val timeoutCallbacks: MutableList<suspend () -> Unit>

What to do after the paginator times out.

Link copied to clipboard
open val timeoutSeconds: Long? = null

Functions

Link copied to clipboard
open suspend fun MessageBuilder.applyPage()

Builder that generates an embed for the paginator's current context.

Link copied to clipboard
open suspend override fun destroy()

Destroy this paginator, removing its buttons and deleting its message if required..

Link copied to clipboard
open fun getChunk(): List<Page>
Link copied to clipboard
open override fun getKoin(): Koin

Get the associated Koin instance.

Link copied to clipboard
open suspend override fun goToPage(page: Int)

Switch to a specific page. Should not call send.

Link copied to clipboard
open suspend override fun nextGroup()

Switch to the next group. Should not call send.

Link copied to clipboard
open suspend fun nextPage()

Convenience function to go to call goToPage with the next page number, if we're not at the last page.

Link copied to clipboard
open fun onTimeout(body: suspend () -> Unit): BasePaginator

Register a callback that is called after the paginator times out.

Link copied to clipboard
open suspend fun previousPage()

Convenience function to go to call goToPage with the previous page number, if we're not at the first page.

Link copied to clipboard
open suspend override fun send()

Send the paginator, given the current context. If it's already sent, update it.

Link copied to clipboard

Replace an enabled interactive button in components with a disabled button of the same ID.

Link copied to clipboard

Replace a disabled button in components with the given interactive button of the same ID.

Link copied to clipboard
open suspend override fun setup()

Should be called as part of send in order to create buttons and get other things set up.

Link copied to clipboard
suspend fun switchGroup(group: Key)

Convenience function to switch to a specific group.

Link copied to clipboard

Convenience function that enables and disables buttons as necessary, depending on the current page number.