Package discord4j.rest.util
Class AllowedMentions
java.lang.Object
discord4j.rest.util.AllowedMentions
A class for holding the allowed_mentions object with an built-in factory for default values.
Also this class wraps the
AllowedMentionsData
JSON to a Discord4J class.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for creatingAllowedMentions
objects.static enum
An allowed mentions type, grouped into role mentions, user mentions and everyone mentions (includes @everyone and @here). -
Method Summary
Modifier and TypeMethodDescriptionstatic AllowedMentions.Builder
builder()
Create a builder for thisAllowedMentions
class.static AllowedMentions.Builder
builder
(AllowedMentions template) Copy an existingAllowedMentions
object to a new builder.static AllowedMentions
from
(discord4j.discordjson.json.AllowedMentionsData allowedMentionsData) Maps anAllowedMentionsData
to a wrappedAllowedMentions
objectmutate()
Copy thisAllowedMentions
object to a new builder.static AllowedMentions
Create anAllowedMentions
object that will suppress all mentions.static AllowedMentions
Create anAllowedMentions
object that will suppress @everyone and @here mentions.discord4j.discordjson.json.AllowedMentionsData
toData()
Map thisAllowedMentions
object to aAllowedMentionsData
JSON
-
Method Details
-
builder
Create a builder for thisAllowedMentions
class. Building this object without any configuration is equivalent to suppressing all mentions.- Returns:
- A builder class for allowed mentions
-
builder
Copy an existingAllowedMentions
object to a new builder.- Parameters:
template
- the allowed mentions object to copy- Returns:
- A builder class for allowed mentions
-
suppressAll
Create anAllowedMentions
object that will suppress all mentions.- Returns:
- A suppressing allowed mentions
-
suppressEveryone
Create anAllowedMentions
object that will suppress @everyone and @here mentions.- Returns:
- A suppressing allowed mentions
-
mutate
Copy thisAllowedMentions
object to a new builder.- Returns:
- A builder class for allowed mentions
-
toData
public discord4j.discordjson.json.AllowedMentionsData toData()Map thisAllowedMentions
object to aAllowedMentionsData
JSON- Returns:
- JSON object
-
from
public static AllowedMentions from(discord4j.discordjson.json.AllowedMentionsData allowedMentionsData) Maps anAllowedMentionsData
to a wrappedAllowedMentions
object- Parameters:
allowedMentionsData
- The data to map- Returns:
- A wrapped
AllowedMentionsData
-