All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.freya022.botcommands.api.pagination.custom.AbstractCustomPagination.kt Maven / Gradle / Ivy

Go to download

A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.

There is a newer version: 3.0.0-alpha.18
Show newest version
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy