Enum Message.MentionType

java.lang.Object
java.lang.Enum<Message.MentionType>
net.dv8tion.jda.api.entities.Message.MentionType
All Implemented Interfaces:
Serializable, Comparable<Message.MentionType>
Enclosing interface:
Message

public static enum Message.MentionType extends Enum<Message.MentionType>
Mention constants, useful for use with Patterns
  • Enum Constant Details

    • USER

      public static final Message.MentionType USER
      Represents a mention for a User/Member
      The first and only group matches the id of the mention.
    • ROLE

      public static final Message.MentionType ROLE
      Represents a mention for a Role
      The first and only group matches the id of the mention.
    • CHANNEL

      public static final Message.MentionType CHANNEL
      Represents a mention for a GuildChannel
      The first and only group matches the id of the mention.
    • EMOJI

      public static final Message.MentionType EMOJI
      Represents a mention for a CustomEmoji
      The first group matches the name of the emoji and the second the id of the mention.
    • HERE

      public static final Message.MentionType HERE
      Represents a mention for all active users, literal @here
    • EVERYONE

      public static final Message.MentionType EVERYONE
      Represents a mention for all users in a server, literal @everyone.
    • SLASH_COMMAND

      public static final Message.MentionType SLASH_COMMAND
      Represents a mention for a slash command.
      The first group is the command name, the second group is the subcommand group name (nullable), the third group is the subcommand name (nullable), and the fourth group is the command ID.
  • Method Details

    • values

      public static Message.MentionType[] 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 Message.MentionType 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
    • getPattern

      @Nonnull public Pattern getPattern()
    • getParseKey

      @Nullable public String getParseKey()
      The Key returned by this method is used to determine the group or parsable mention group they are part of.
      It is used internally in methods like MessageRequest.setAllowedMentions(Collection).

      Returns null, when they don't belong to any mention group.

      Returns:
      Nullable group key for mention parsing