Enum Emote

java.lang.Object
java.lang.Enum<Emote>
com.github.ygimenez.type.Emote
All Implemented Interfaces:
Serializable, Comparable<Emote>, java.lang.constant.Constable

public enum Emote extends Enum<Emote>
Enumerator representing values required by non-dynamic buttons.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Emote representing the "accept" button (default: ✅).
    Emote representing the "cancel" button (default: ❎).
    Emote representing the "go to first" button (default: ⏮).
    Emote representing the "go to last" button (default: ⏭).
    Emote representing the "next" button (default: ▶).
    Emote representing nothing.
    Emote representing the "previous" button (default: ◀).
    Emote representing the "skip backward" button (default: ⏪).
    Emote representing the "skip forward" button (default: ⏩).
  • Method Summary

    Modifier and Type
    Method
    Description
    static Emote
    fromButton​(net.dv8tion.jda.api.interactions.components.buttons.Button btn)
    Returns the Emote represented by the supplied Button, if any.
    static Emote
    getByEmoji​(net.dv8tion.jda.api.entities.emoji.Emoji emoji)
    Retrieves the Emote linked to supplied Emoji.
    net.dv8tion.jda.api.entities.emoji.Emoji
    Retrieves this Emote's default Emoji.
    static String
    getId​(net.dv8tion.jda.api.entities.emoji.Emoji emj)
    Utility method for retrieving an Emoji's effective ID.
    net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle
    Retrieves this Emote's ButtonStyle.
    static boolean
    isNative​(net.dv8tion.jda.api.entities.MessageReaction react)
    Checks whether the supplied MessageReaction is referenced by a library emote or not.
    static boolean
    isNative​(net.dv8tion.jda.api.interactions.components.buttons.Button btn)
    Checks whether the supplied Button is referenced by a library emote or not.
    static Emote
    valueOf​(String name)
    Returns the enum constant of this type with the specified name.
    static Emote[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NEXT

      public static final Emote NEXT
      Emote representing the "next" button (default: ▶).
    • PREVIOUS

      public static final Emote PREVIOUS
      Emote representing the "previous" button (default: ◀).
    • ACCEPT

      public static final Emote ACCEPT
      Emote representing the "accept" button (default: ✅).
    • CANCEL

      public static final Emote CANCEL
      Emote representing the "cancel" button (default: ❎).
    • SKIP_FORWARD

      public static final Emote SKIP_FORWARD
      Emote representing the "skip forward" button (default: ⏩).
    • SKIP_BACKWARD

      public static final Emote SKIP_BACKWARD
      Emote representing the "skip backward" button (default: ⏪).
    • GOTO_FIRST

      public static final Emote GOTO_FIRST
      Emote representing the "go to first" button (default: ⏮).
    • GOTO_LAST

      public static final Emote GOTO_LAST
      Emote representing the "go to last" button (default: ⏭).
    • NONE

      public static final Emote NONE
      Emote representing nothing.
  • Method Details

    • values

      public static Emote[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Emote valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getDefault

      public net.dv8tion.jda.api.entities.emoji.Emoji getDefault()
      Retrieves this Emote's default Emoji.
      Returns:
      This Emote's default Emoji.
    • getStyle

      public net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle getStyle()
      Retrieves this Emote's ButtonStyle.
      Returns:
      This Emote's ButtonStyle.
    • getByEmoji

      public static Emote getByEmoji(@NotNull net.dv8tion.jda.api.entities.emoji.Emoji emoji)
      Retrieves the Emote linked to supplied Emoji.
      Parameters:
      emoji - The Emoji to be searched for.
      Returns:
      The respective Emote, or NONE if it didn't match any.
    • isNative

      public static boolean isNative(@NotNull net.dv8tion.jda.api.interactions.components.buttons.Button btn)
      Checks whether the supplied Button is referenced by a library emote or not.
      Parameters:
      btn - The Button to be checked.
      Returns:
      Whether it uses a Emote value or not.
    • isNative

      public static boolean isNative(@NotNull net.dv8tion.jda.api.entities.MessageReaction react)
      Checks whether the supplied MessageReaction is referenced by a library emote or not.
      Parameters:
      react - The MessageReaction to be checked.
      Returns:
      Whether it uses a Emote value or not.
    • getId

      public static String getId(@NotNull net.dv8tion.jda.api.entities.emoji.Emoji emj)
      Utility method for retrieving an Emoji's effective ID.
      Parameters:
      emj - The Emoji to be used.
      Returns:
      The supplied Emoji's effective ID.
    • fromButton

      @Nullable public static Emote fromButton(@NotNull net.dv8tion.jda.api.interactions.components.buttons.Button btn)
      Returns the Emote represented by the supplied Button, if any.
      Parameters:
      btn - The Button to be checked.
      Returns:
      The Emote linked to the supplied Button, or null if none.