Class ForumTagData
java.lang.Object
net.dv8tion.jda.api.entities.channel.forums.ForumTagData
- All Implemented Interfaces:
BaseForumTag
,SerializableData
Data class used to create or update existing forum tags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ForumTagData
from
(BaseForumTag tag) Creates a newForumTagData
instance based on the providedBaseForumTag
.getEmoji()
The emoji used as the tag icon.getName()
The name of the tag.boolean
Whether this tag can only be applied by moderators with theMANAGE_THREADS
permission (aka Manage Posts).Set the emoji to use for this tag.setModerated
(boolean moderated) Set whether the tag can only be applied by forum moderators.Set the new tag name to use.toData()
SerializedDataObject
for this object.toString()
-
Constructor Details
-
ForumTagData
Create a newForumTagData
instance.- Parameters:
name
- The tag name (1-20 characters)- Throws:
IllegalArgumentException
- If the provided name is null or not between 1 and 20 characters long
-
-
Method Details
-
from
Creates a newForumTagData
instance based on the providedBaseForumTag
.
This also binds to the id of the provided tag, if available.- Parameters:
tag
- The base tag to use- Returns:
- The new
ForumTagData
instance - Throws:
IllegalArgumentException
- If null is provided or the tag has an invalid name
-
setName
Set the new tag name to use.- Parameters:
name
- The new tag name (1-20 characters)- Returns:
- The updated ForumTagData instance
- Throws:
IllegalArgumentException
- If the provided name is null or not between 1 and 20 characters long
-
setModerated
Set whether the tag can only be applied by forum moderators.- Parameters:
moderated
- True, if the tag is restricted to moderators- Returns:
- The updated ForumTagData instance
- See Also:
-
setEmoji
Set the emoji to use for this tag.
This emoji is displayed as an icon attached to the tag.- Parameters:
emoji
- The emoji icon of the tag- Returns:
- The updated ForumTagData instance
-
getName
Description copied from interface:BaseForumTag
The name of the tag.- Specified by:
getName
in interfaceBaseForumTag
- Returns:
- The name
-
isModerated
public boolean isModerated()Description copied from interface:BaseForumTag
Whether this tag can only be applied by moderators with theMANAGE_THREADS
permission (aka Manage Posts).- Specified by:
isModerated
in interfaceBaseForumTag
- Returns:
- True, if this tag can only be applied by moderators with the required permission
-
getEmoji
Description copied from interface:BaseForumTag
The emoji used as the tag icon.
For custom emoji, this will have an empty name andCustomEmoji.isAnimated()
is alwaysfalse
, due to discord chicanery.- Specified by:
getEmoji
in interfaceBaseForumTag
- Returns:
EmojiUnion
representing the tag emoji, or null if no emoji is applied.
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceBaseForumTag
- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
toString
-