Package com.github.ygimenez.model
Class InteractPage
java.lang.Object
com.github.ygimenez.model.Page
com.github.ygimenez.model.InteractPage
Class representing either a
Message or MessageEmbed object.
Fundamentally the same as Page but will use Buttons instead of emotes.-
Constructor Summary
ConstructorsConstructorDescriptionInteractPage(Object content)AnInteractPageobject to be used in this library's methods. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves currentMapofButtoncaptions.Map<net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle,net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle>Retrieves currentMapofButtonstyle overrides.net.dv8tion.jda.api.interactions.components.buttons.ButtonmakeButton(Emote emt)Creates a newButtonfrom configured styles and captions.net.dv8tion.jda.api.interactions.components.buttons.ButtonmakeButton(net.dv8tion.jda.api.entities.emoji.Emoji emj)Creates a newButton, but without any style or caption applied to it.net.dv8tion.jda.api.interactions.components.buttons.ButtonmakeButton(net.dv8tion.jda.api.entities.emoji.Emoji emj, String caption)Creates a newButton, but without any style applied to it.voidoverrideStyle(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle original, net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle override)Override aButtonstyle (for example, makingEmote.ACCEPTbutton become red).Methods inherited from class com.github.ygimenez.model.Page
getContent, toString
-
Constructor Details
-
InteractPage
AnInteractPageobject to be used in this library's methods. Currently, onlyMessageandMessageEmbedare supported.- Parameters:
content- TheMessage/MessageEmbedobject to be used as pages.- Throws:
IllegalArgumentException- Thrown if argument is not aMessagenorMessageEmbed.
-
-
Method Details
-
getStyles
public Map<net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle,net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle> getStyles()Retrieves currentMapofButtonstyle overrides.- Returns:
- The
Mapof style overrides.
-
overrideStyle
public void overrideStyle(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle original, net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle override)Override aButtonstyle (for example, makingEmote.ACCEPTbutton become red).- Parameters:
original- The original style to be overridden.override- The new style.
-
getCaptions
Retrieves currentMapofButtoncaptions.- Returns:
- The
Mapof captions.
-
makeButton
Creates a newButtonfrom configured styles and captions.- Parameters:
emt- TheEmoterepresenting theButton, must never be null since it is also the ID.
If you supplyEmote.NONEa blank disabled button will be created.- Returns:
- The created
Button.
-
makeButton
public net.dv8tion.jda.api.interactions.components.buttons.Button makeButton(@NotNull net.dv8tion.jda.api.entities.emoji.Emoji emj)Creates a newButton, but without any style or caption applied to it.- Parameters:
emj- TheEmojirepresenting theButton, must never be null since it is also the ID.- Returns:
- The created
Button.
-
makeButton
public net.dv8tion.jda.api.interactions.components.buttons.Button makeButton(@NotNull net.dv8tion.jda.api.entities.emoji.Emoji emj, String caption)Creates a newButton, but without any style applied to it.- Parameters:
emj- TheEmojirepresenting theButton, must never be null since it is also the ID.caption- The desired caption for theButton.- Returns:
- The created
Button.
-