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

io.github.freya022.botcommands.api.pagination.interactive.InteractiveMenuSupplier 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.22
Show newest version
package io.github.freya022.botcommands.api.pagination.interactive;

import io.github.freya022.botcommands.api.pagination.PaginatorComponents;
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.interactions.components.LayoutComponent;
import net.dv8tion.jda.api.utils.messages.MessageEditBuilder;
import org.jetbrains.annotations.NotNull;

/**
 * @see #get(T, int, MessageEditBuilder, PaginatorComponents)
 */
public interface InteractiveMenuSupplier> {
	/**
	 * Returns the {@link MessageEmbed} for this interactive menu's page
	 *
	 * @param interactiveMenu The interaction menu instance this interactive menu supplier is for, for example this may allow you to:
	 *                        
    *
  • Modify the interactive menu's state when a button is triggered
  • *
  • Delete the menu, cancel the timeout and cleanup the components when a button is clicked
  • *
* @param pageNumber The page number of the currently displayed menu * @param editBuilder The {@link MessageEditBuilder} for this interactive menu, you can mostly ignore it but can use it to add attachments for examples, to use them in your embeds * @param components The {@link PaginatorComponents} for this interactive menu's page, this allows you to add components on this page *
Do not use {@link MessageEditBuilder#setComponents(LayoutComponent...)} and such, these will be overridden by the menu * * @return A {@link MessageEmbed} for this interactive menu's page */ @NotNull MessageEmbed get(@NotNull T interactiveMenu, int pageNumber, @NotNull MessageEditBuilder editBuilder, @NotNull PaginatorComponents components); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy