Interface Button

    • Method Detail

      • getStyle

        ButtonStyle getStyle​()
        Get the button's style.
        Returns:
        The button's style.
      • getCustomId

        Optional<String> getCustomId​()
        Get the button's identifier.
        Returns:
        The button's custom identifier.
      • getLabel

        Optional<String> getLabel​()
        Get the button's label.
        Returns:
        The button's label.
      • getUrl

        Optional<String> getUrl​()
        Get the button's clickable URL.
        Returns:
        The button's URL.
      • isDisabled

        Optional<Boolean> isDisabled​()
        Get whether or not the button is disabled.
        Returns:
        Whether or not the button is disabled.
      • getEmoji

        Optional<Emoji> getEmoji​()
        Get the emoji button's emoji.
        Returns:
        The emoji button's emoji.
      • danger

        static Button danger​(String customId,
                             String label)
        Create a new button with the red danger style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • danger

        static Button danger​(String customId,
                             String label,
                             Emoji emoji)
        Create a new button with the red danger style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • danger

        static Button danger​(String customId,
                             String label,
                             String unicodeEmoji)
        Create a new button with the red danger style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        unicodeEmoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • danger

        static Button danger​(String customId,
                             Emoji emoji)
        Create a new button with the red danger style and the given emoji. If you want to use an unicode emoji, use danger(String, String, String) instead and pass null as your label. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • primary

        static Button primary​(String customId,
                              String label)
        Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • primary

        static Button primary​(String customId,
                              String label,
                              Emoji emoji)
        Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • primary

        static Button primary​(String customId,
                              String label,
                              String unicodeEmoji)
        Create a new button with the blurple primary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        unicodeEmoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • primary

        static Button primary​(String customId,
                              Emoji emoji)
        Create a new button with the blurple primary style and the given emoji. If you want to use an unicode emoji, use primary(String, String, String) instead and pass null as your label. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • secondary

        static Button secondary​(String customId,
                                String label)
        Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • secondary

        static Button secondary​(String customId,
                                String label,
                                Emoji emoji)
        Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • secondary

        static Button secondary​(String customId,
                                String label,
                                String unicodeEmoji)
        Create a new button with the grey secondary style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        unicodeEmoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • secondary

        static Button secondary​(String customId,
                                Emoji emoji)
        Create a new button with the grey secondary style and the given emoji. If you only want to use an unicode emoji, use secondary(String, String, String) instead and pass null as your label. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • success

        static Button success​(String customId,
                              String label)
        Create a new button with the green success style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • success

        static Button success​(String customId,
                              String label,
                              Emoji emoji)
        Create a new button with the green success style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • success

        static Button success​(String customId,
                              String label,
                              String unicodeEmoji)
        Create a new button with the green success style and the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        label - The label for this button.
        unicodeEmoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • success

        static Button success​(String customId,
                              Emoji emoji)
        Create a new button with the green success style and the given emoji. If you only want to use an unicode emoji, use success(String, String, String) instead and pass null as your label. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • link

        static Button link​(String url,
                           String label)
        Create a new button for a link button. This is a convenience shorthand method.
        Parameters:
        url - The url for this link button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • link

        static Button link​(String url,
                           String label,
                           Emoji emoji)
        Create a new button for a link button. This is a convenience shorthand method.
        Parameters:
        url - The url for this link button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • link

        static Button link​(String url,
                           String label,
                           String unicodeEmoji)
        Create a new button for a link button. This is a convenience shorthand method.
        Parameters:
        url - The url for this link button.
        label - The label for this button.
        unicodeEmoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • link

        static Button link​(String url,
                           Emoji emoji)
        Create a new button for a link button. If you only want to use an unicode emoji, use link(String, String, String) instead and pass null as your label. This is a convenience shorthand method.
        Parameters:
        url - The url for this link button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • create

        static Button create​(String customId,
                             ButtonStyle style,
                             String label)
        Create a new button with the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        style - The button style for this button.
        label - The label for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • create

        static Button create​(String customId,
                             ButtonStyle style,
                             String label,
                             Emoji emoji)
        Create a new button with the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        style - The button style for this button.
        label - The label for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • create

        static Button create​(String customId,
                             ButtonStyle style,
                             String label,
                             String unicodeEmoji)
        Create a new button with the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        style - The button style for this button.
        label - The label for this button.
        unicodeEmoji - The unicode emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message
      • create

        static Button create​(String customId,
                             ButtonStyle style,
                             Emoji emoji)
        Create a new button with the given properties. This is a convenience shorthand method.
        Parameters:
        customId - The custom id for this button.
        style - The button style for this button.
        emoji - The emoji for this button.
        Returns:
        the new button to be used with an ActionRow or a message