Interface Category
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,ICopyableChannel,IDetachableEntity,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISnowflake
Categories are used to keep order in a Guild by dividing the channels into groups.
- See Also:
-
Guild.getCategoryCache()IGuildChannelContainer.getCategories()IGuildChannelContainer.getCategoriesByName(String, boolean)IGuildChannelContainer.getCategoryById(long)IGuildChannelContainer.getCategoryCache()IGuildChannelContainer.getCategories()IGuildChannelContainer.getCategoriesByName(String, boolean)IGuildChannelContainer.getCategoryById(long)
-
Field Summary
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_URL -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of the specifiedGuildChannel.createCopy(Guild guild) Creates a copy of the specifiedGuildChannelin the specifiedGuild.createForumChannel(String name) Creates a newForumChannelwith this Category as parent.createMediaChannel(String name) Creates a newMediaChannelwith this Category as parent.createNewsChannel(String name) Creates a newNewsChannelwith this Category as parent.createStageChannel(String name) Creates a newStageChannelwith this Category as parent.createTextChannel(String name) Creates a newTextChannelwith this Category as parent.createVoiceChannel(String name) Creates a newVoiceChannelwith this Category as parent.default @Unmodifiable List<GuildChannel>AllChannelslisted for this Category.default @Unmodifiable List<ForumChannel>AllForumChannelslisted for this CategoryReturns theChannelManagerfor this GuildChannel.default @Unmodifiable List<MediaChannel>AllMediaChannelslisted for this CategoryA List of allMembersthat are in this GuildChannel
ForTextChannels, this returns all Members with thePermission.VIEW_CHANNELPermission.default @Unmodifiable List<NewsChannel>AllNewsChannelslisted for this Categorydefault @Unmodifiable List<StageChannel>AllStageChannellisted for this Categorydefault @Unmodifiable List<TextChannel>AllTextChannelslisted for this Categorydefault @Unmodifiable List<VoiceChannel>AllVoiceChannelslisted for this CategoryModifies the positional order of this Category's nestedTextChannelsandNewsChannels.Modifies the positional order of this Category's nestedVoiceChannelsandStageChannels.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getTypeMethods 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.detached.IDetachableEntity
isDetachedMethods 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.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getChannels
AllChannelslisted for this Category.
Includes all types of channels, except for threads.- Returns:
- Immutable list of all child channels
- Throws:
DetachedEntityException- If this entity isdetached
-
getTextChannels
AllTextChannelslisted for this Category- Returns:
- Immutable list of all child TextChannels
- Throws:
DetachedEntityException- If this entity isdetached
-
getNewsChannels
AllNewsChannelslisted for this Category- Returns:
- Immutable list of all child NewsChannels
- Throws:
DetachedEntityException- If this entity isdetached
-
getForumChannels
AllForumChannelslisted for this Category- Returns:
- Immutable list of all child ForumChannels
- Throws:
DetachedEntityException- If this entity isdetached
-
getMediaChannels
AllMediaChannelslisted for this Category- Returns:
- Immutable list of all child ForumChannels
- Throws:
DetachedEntityException- If this entity isdetached
-
getVoiceChannels
AllVoiceChannelslisted for this Category- Returns:
- Immutable list of all child VoiceChannels
- Throws:
DetachedEntityException- If this entity isdetached
-
getStageChannels
AllStageChannellisted for this Category- Returns:
- Immutable list of all child StageChannel
- Throws:
DetachedEntityException- If this entity isdetached
-
createTextChannel
Creates a newTextChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the TextChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new TextChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
createNewsChannel
Creates a newNewsChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the NewsChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new NewsChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
createVoiceChannel
Creates a newVoiceChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the VoiceChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new VoiceChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
createStageChannel
Creates a newStageChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the StageChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new StageChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
createForumChannel
Creates a newForumChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the ForumChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new ForumChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
createMediaChannel
Creates a newMediaChannelwith this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNELPermission in this Category.This will copy all
PermissionOverridesof this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)for details.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_CHANNELS
The maximum number of channels were exceeded
- Parameters:
name- The name of the MediaChannel to create (up to 100 characters)- Returns:
- A specific
ChannelAction
This action allows to set fields for the new MediaChannel before creating it - Throws:
InsufficientPermissionException- If the logged in account does not have thePermission.MANAGE_CHANNELpermissionIllegalArgumentException- If the provided name isnull, empty, or longer than 100 charactersDetachedEntityException- If this entity isdetached
-
modifyTextChannelPositions
Modifies the positional order of this Category's nestedTextChannelsandNewsChannels.
This uses an extension ofChannelOrderActionspecialized for ordering the nestedTextChannelsandNewsChannelsof thisCategory.
LikeChannelOrderAction, the returnedCategoryOrderActioncan be used to move TextChannels/NewsChannelsup,down, ortoa specific position.
This uses ascending order with a 0 based index.Possible
ErrorResponsesinclude:UNNKOWN_CHANNEL
One of the channels has been deleted before the completion of the task.MISSING_ACCESS
The currently logged in account was removed from the Guild.
- Returns:
- A
CategoryOrderActionfor ordering the Category'sTextChannelsandNewsChannels. - Throws:
DetachedEntityException- If this entity isdetached
-
modifyVoiceChannelPositions
Modifies the positional order of this Category's nestedVoiceChannelsandStageChannels.
This uses an extension ofChannelOrderActionspecialized for ordering the nestedVoiceChannelsandStageChannelsof thisCategory.
LikeChannelOrderAction, the returnedCategoryOrderActioncan be used to move VoiceChannels/StageChannelsup,down, ortoa specific position.
This uses ascending order with a 0 based index.Possible
ErrorResponsesinclude:UNNKOWN_CHANNEL
One of the channels has been deleted before the completion of the task.MISSING_ACCESS
The currently logged in account was removed from the Guild.
- Returns:
- A
CategoryOrderActionfor ordering the Category'sVoiceChannelsandStageChannels. - Throws:
DetachedEntityException- If this entity isdetached
-
getMembers
Description copied from interface:IMemberContainerA List of allMembersthat are in this GuildChannel
ForTextChannels, this returns all Members with thePermission.VIEW_CHANNELPermission.
ForVoiceChannels, this returns all Members that joined that VoiceChannel.
ForCategories, this returns all Members who are in its child channels.- Specified by:
getMembersin interfaceIMemberContainer- Returns:
- An immutable List of
Membersthat are in this GuildChannel.
-
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- 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- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
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 interfaceIPermissionContainer- Specified by:
getManagerin interfaceIPositionableChannel- Returns:
- The ChannelManager of this GuildChannel
-