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
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for creatingAllowedMentionsobjects.static enumAn allowed mentions type, grouped into role mentions, user mentions and everyone mentions (includes @everyone and @here). -
Method Summary
Modifier and TypeMethodDescriptionstatic AllowedMentions.Builderbuilder()Create a builder for thisAllowedMentionsclass.static AllowedMentions.Builderbuilder(AllowedMentions template) Copy an existingAllowedMentionsobject to a new builder.static AllowedMentionsfrom(discord4j.discordjson.json.AllowedMentionsData allowedMentionsData) Maps anAllowedMentionsDatato a wrappedAllowedMentionsobjectmutate()Copy thisAllowedMentionsobject to a new builder.static AllowedMentionsCreate anAllowedMentionsobject that will suppress all mentions.static AllowedMentionsCreate anAllowedMentionsobject that will suppress @everyone and @here mentions.discord4j.discordjson.json.AllowedMentionsDatatoData()Map thisAllowedMentionsobject to aAllowedMentionsDataJSON
-
Method Details
-
builder
Create a builder for thisAllowedMentionsclass. Building this object without any configuration is equivalent to suppressing all mentions.- Returns:
- A builder class for allowed mentions
-
builder
Copy an existingAllowedMentionsobject to a new builder.- Parameters:
template- the allowed mentions object to copy- Returns:
- A builder class for allowed mentions
-
suppressAll
Create anAllowedMentionsobject that will suppress all mentions.- Returns:
- A suppressing allowed mentions
-
suppressEveryone
Create anAllowedMentionsobject that will suppress @everyone and @here mentions.- Returns:
- A suppressing allowed mentions
-
mutate
Copy thisAllowedMentionsobject to a new builder.- Returns:
- A builder class for allowed mentions
-
toData
public discord4j.discordjson.json.AllowedMentionsData toData()Map thisAllowedMentionsobject to aAllowedMentionsDataJSON- Returns:
- JSON object
-
from
public static AllowedMentions from(discord4j.discordjson.json.AllowedMentionsData allowedMentionsData) Maps anAllowedMentionsDatato a wrappedAllowedMentionsobject- Parameters:
allowedMentionsData- The data to map- Returns:
- A wrapped
AllowedMentionsData
-