Package net.dv8tion.jda.api.entities
Enum Message.MentionType
- All Implemented Interfaces:
Serializable
,Comparable<Message.MentionType>
- Enclosing interface:
Message
Mention constants, useful for use with
Patterns
-
Enum Constant Summary
Enum ConstantDescriptionRepresents a mention for aGuildChannel
The first and only group matches the id of the mention.Represents a mention for aCustomEmoji
The first group matches the name of the emoji and the second the id of the mention.Represents a mention for all users in a server, literal@everyone
.Represents a mention for all active users, literal@here
Represents a mention for aRole
The first and only group matches the id of the mention.Represents a mention for a slash command. -
Method Summary
Modifier and TypeMethodDescriptionThe Key returned by this method is used to determine the group or parsable mention group they are part of.static Message.MentionType
Returns the enum constant of this type with the specified name.static Message.MentionType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
USER
-
ROLE
Represents a mention for aRole
The first and only group matches the id of the mention. -
CHANNEL
Represents a mention for aGuildChannel
The first and only group matches the id of the mention. -
EMOJI
Represents a mention for aCustomEmoji
The first group matches the name of the emoji and the second the id of the mention. -
HERE
Represents a mention for all active users, literal@here
-
EVERYONE
Represents a mention for all users in a server, literal@everyone
. -
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
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
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 nameNullPointerException
- if the argument is null
-
getPattern
-
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 likeMessageRequest.setAllowedMentions(Collection)
.Returns
null
, when they don't belong to any mention group.- Returns:
- Nullable group key for mention parsing
-