Class InteractPage

java.lang.Object
com.github.ygimenez.model.Page
com.github.ygimenez.model.InteractPage

public class InteractPage extends Page
Class representing either a Message or MessageEmbed object. Fundamentally the same as Page but will use Buttons instead of emotes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    InteractPage​(Object content)
    An InteractPage object to be used in this library's methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves current Map of Button captions.
    Map<net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle,​net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle>
    Retrieves current Map of Button style overrides.
    net.dv8tion.jda.api.interactions.components.buttons.Button
    makeButton​(Emote emt)
    Creates a new Button from configured styles and captions.
    net.dv8tion.jda.api.interactions.components.buttons.Button
    makeButton​(net.dv8tion.jda.api.entities.emoji.Emoji emj)
    Creates a new Button, but without any style or caption applied to it.
    net.dv8tion.jda.api.interactions.components.buttons.Button
    makeButton​(net.dv8tion.jda.api.entities.emoji.Emoji emj, String caption)
    Creates a new Button, but without any style applied to it.
    void
    overrideStyle​(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle original, net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle override)
    Override a Button style (for example, making Emote.ACCEPT button become red).

    Methods inherited from class com.github.ygimenez.model.Page

    getContent, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • InteractPage

      public InteractPage(@NotNull Object content) throws IllegalArgumentException
      An InteractPage object to be used in this library's methods. Currently, only Message and MessageEmbed are supported.
      Parameters:
      content - The Message/MessageEmbed object to be used as pages.
      Throws:
      IllegalArgumentException - Thrown if argument is not a Message nor MessageEmbed.
  • Method Details

    • getStyles

      public Map<net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle,​net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle> getStyles()
      Retrieves current Map of Button style overrides.
      Returns:
      The Map of 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 a Button style (for example, making Emote.ACCEPT button become red).
      Parameters:
      original - The original style to be overridden.
      override - The new style.
    • getCaptions

      public Map<Emote,​String> getCaptions()
      Retrieves current Map of Button captions.
      Returns:
      The Map of captions.
    • makeButton

      public net.dv8tion.jda.api.interactions.components.buttons.Button makeButton(@NotNull Emote emt)
      Creates a new Button from configured styles and captions.
      Parameters:
      emt - The Emote representing the Button, must never be null since it is also the ID.
      If you supply Emote.NONE a 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 new Button, but without any style or caption applied to it.
      Parameters:
      emj - The Emoji representing the Button, 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 new Button, but without any style applied to it.
      Parameters:
      emj - The Emoji representing the Button, must never be null since it is also the ID.
      caption - The desired caption for the Button.
      Returns:
      The created Button.