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 ForumTagDatafrom(BaseForumTag tag) Creates a newForumTagDatainstance based on the providedBaseForumTag.getEmoji()The emoji used as the tag icon.getName()The name of the tag.booleanWhether this tag can only be applied by moderators with theMANAGE_THREADSpermission (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()SerializedDataObjectfor this object.toString()
-
Constructor Details
-
ForumTagData
Create a newForumTagDatainstance.- 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 newForumTagDatainstance 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
ForumTagDatainstance - 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:BaseForumTagThe name of the tag.- Specified by:
getNamein interfaceBaseForumTag- Returns:
- The name
-
isModerated
public boolean isModerated()Description copied from interface:BaseForumTagWhether this tag can only be applied by moderators with theMANAGE_THREADSpermission (aka Manage Posts).- Specified by:
isModeratedin interfaceBaseForumTag- Returns:
- True, if this tag can only be applied by moderators with the required permission
-
getEmoji
Description copied from interface:BaseForumTagThe 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:
getEmojiin interfaceBaseForumTag- Returns:
EmojiUnionrepresenting the tag emoji, or null if no emoji is applied.
-
toData
Description copied from interface:SerializableDataSerializedDataObjectfor this object.- Specified by:
toDatain interfaceBaseForumTag- Specified by:
toDatain interfaceSerializableData- Returns:
DataObject
-
toString
-