io.github.freya022.botcommands.api.pagination.custom.AbstractCustomPagination.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of BotCommands Show documentation
Show all versions of BotCommands Show documentation
A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.
package io.github.freya022.botcommands.api.pagination.custom
import io.github.freya022.botcommands.api.core.BContext
import io.github.freya022.botcommands.api.pagination.AbstractPagination
/**
* @param T Type of the implementor
*/
abstract class AbstractCustomPagination> protected constructor(
context: BContext,
builder: AbstractCustomPaginationBuilder<*, T>
) : AbstractPagination(context, builder) {
abstract var maxPages: Int
protected set
/**
* The page number, after changing this value, you can update the message with the new content from [getCurrentMessage].
*
* The page must be between `0` and [`maxPages - 1`][maxPages]
*/
var page: Int = 0
set(value) {
// 0 <= value < maxPages
require(value in 0..= maxPages - 1
}