Interface ForumChannel
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,IAgeRestrictedChannel,ICategorizableChannel,ICopyableChannel,IInviteContainer,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISlowmodeChannel,ISnowflake,IThreadContainer,IWebhookContainer,StandardGuildChannel
Forum Posts.
Forum posts are simply
ThreadChannels of type ChannelType.GUILD_PUBLIC_THREAD.
The CREATE POSTS permission that is shown in the official Discord Client, is an alias for Permission.MESSAGE_SEND.
Permission.CREATE_PUBLIC_THREADS is ignored for creating forum posts.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe layout used to sort forum posts. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum length of a forum topic (4096)static final intThe maximum number oftagsthat can be applied to a forum post.Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTHFields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URLFields inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ISlowmodeChannel
MAX_SLOWMODE -
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelAction<ForumChannel>Creates a copy of the specifiedGuildChannel.createCopy(Guild guild) Creates a copy of the specifiedGuildChannelin the specifiedGuild.createForumPost(String name, MessageCreateData message) Creates a new forum post (thread) in this forum.default ForumTaggetAvailableTagById(long id) Retrieves the tag for the provided id.default ForumTagRetrieves the tag for the provided id.The availableForumTagsfor this forum channel.The availableForumTagsfor this forum channel.getAvailableTagsByName(String name, boolean ignoreCase) The availableForumTagsfor this forum channel.The default layout used to show threads.The emoji which will show up on new forum posts as default reaction.Returns theChannelManagerfor this GuildChannel.getTopic()The topic set for this channel, this is referred to as Guidelines in the official Discord client.default ChannelTypegetType()TheChannelTypefor this channeldefault booleanWhether all new forum posts must have a tag.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getNameMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainerMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IAgeRestrictedChannel
isNSFWMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, isSyncedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IInviteContainer
createInvite, retrieveInvitesMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IMemberContainer
getMembersMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainer
getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPositionableChannel
getPosition, getPositionRawMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ISlowmodeChannel
getSlowmodeMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IThreadContainer
createThreadChannel, createThreadChannel, createThreadChannel, createThreadChannel, getDefaultThreadSlowmode, getThreadChannels, retrieveArchivedPrivateJoinedThreadChannels, retrieveArchivedPrivateThreadChannels, retrieveArchivedPublicThreadChannelsMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IWebhookContainer
createWebhook, deleteWebhookById, retrieveWebhooks
-
Field Details
-
MAX_FORUM_TOPIC_LENGTH
static final int MAX_FORUM_TOPIC_LENGTHThe maximum length of a forum topic (4096)- See Also:
-
MAX_POST_TAGS
static final int MAX_POST_TAGSThe maximum number oftagsthat can be applied to a forum post. (5)- See Also:
-
-
Method Details
-
getType
Description copied from interface:ChannelTheChannelTypefor this channel -
getManager
Description copied from interface:GuildChannelReturns theChannelManagerfor this GuildChannel.
In the ChannelManager, you can modify the name, topic and position of this GuildChannel. You modify multiple fields in one request by chaining setters before callingRestAction.queue().- Specified by:
getManagerin interfaceGuildChannel- Specified by:
getManagerin interfaceICategorizableChannel- Specified by:
getManagerin interfaceIPermissionContainer- Specified by:
getManagerin interfaceIPositionableChannel- Specified by:
getManagerin interfaceISlowmodeChannel- Specified by:
getManagerin interfaceStandardGuildChannel- Returns:
- The ChannelManager of this GuildChannel
- See Also:
-
createCopy
Description copied from interface:ICopyableChannelCreates a copy of the specifiedGuildChannelin the specifiedGuild.
If the provided target guild is not the same Guild this channel is in then the parent category and permissions will not be copied due to technical difficulty and ambiguity.This copies the following elements:
- Name
- Parent Category (if present)
- Voice Elements (Bitrate, Userlimit)
- Text Elements (Topic, NSFW, Slowmode)
- All permission overrides for Members/Roles
Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removed
- Specified by:
createCopyin interfaceICopyableChannel- Specified by:
createCopyin interfaceStandardGuildChannel- Parameters:
guild- TheGuildto create the channel in- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
createCopy
Description copied from interface:ICopyableChannelCreates a copy of the specifiedGuildChannel.This copies the following elements:
- Name
- Parent Category (if present)
- Voice Elements (Bitrate, Userlimit)
- Text Elements (Topic, NSFW, Slowmode)
- All permission overrides for Members/Roles
Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removed
- Specified by:
createCopyin interfaceICopyableChannel- Specified by:
createCopyin interfaceStandardGuildChannel- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
getAvailableTagCache
The availableForumTagsfor this forum channel.
Tags are sorted by theirpositionascending.This requires
CacheFlag.FORUM_TAGSto be enabled.- Returns:
SortedSnowflakeCacheViewofForumTag
-
getAvailableTags
The availableForumTagsfor this forum channel.
Tags are sorted by theirpositionascending.This is a shortcut for
getAvailableTagCache().asList(). This method will copy the underlying cache into the list, running inO(n)time.This requires
CacheFlag.FORUM_TAGSto be enabled. -
getAvailableTagsByName
The availableForumTagsfor this forum channel.
Tags are sorted by theirpositionascending.This is a shortcut for
getAvailableTagCache().getElementsByName(name, ignoreCase). This method will copy the underlying cache into the list, running inO(n)time.This requires
CacheFlag.FORUM_TAGSto be enabled.- Parameters:
name- The name of the tagignoreCase- Whether to useString.equalsIgnoreCase(String)- Returns:
- Immutable
ListofForumTagwith the given name - Throws:
IllegalArgumentException- If the name isnull
-
getAvailableTagById
Retrieves the tag for the provided id.This requires
CacheFlag.FORUM_TAGSto be enabled.- Parameters:
id- The tag id- Returns:
- The tag for the provided id, or
nullif no tag with that id exists - See Also:
-
getAvailableTagById
Retrieves the tag for the provided id.This requires
CacheFlag.FORUM_TAGSto be enabled.- Parameters:
id- The tag id- Returns:
- The tag for the provided id, or
nullif no tag with that id exists - Throws:
IllegalArgumentException- If the provided id is nullNumberFormatException- If the provided id is not a valid snowflake- See Also:
-
getTopic
The topic set for this channel, this is referred to as Guidelines in the official Discord client.
If no topic has been set, this returns null.- Returns:
- Possibly-null String containing the topic of this channel.
-
isTagRequired
default boolean isTagRequired()Whether all new forum posts must have a tag.- Returns:
- True, if all new posts must have a tag.
-
getDefaultReaction
The emoji which will show up on new forum posts as default reaction.- Returns:
- The default reaction for new forum posts.
-
getDefaultLayout
The default layout used to show threads.- Returns:
- The default layout used to show threads.
-
createForumPost
@Nonnull @Incubating @CheckReturnValue ForumPostAction createForumPost(@Nonnull String name, @Nonnull MessageCreateData message) Creates a new forum post (thread) in this forum.Possible
ErrorResponsesinclude:UNKNOWN_CHANNEL
If the forum channel was deletedREQUEST_ENTITY_TOO_LARGE
If the total sum of uploaded bytes exceeds the guild'supload limit
- Parameters:
name- The name of the post (up to 100 characters)message- The starting message of the post (seeMessageCreateBuilder)- Returns:
ForumPostAction- Throws:
InsufficientPermissionException- If the bot does not havePermission.MESSAGE_SENDin the channelIllegalArgumentException-- If null is provided
- If the name is empty or longer than 100 characters
-