Interface Category
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,ICopyableChannel,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISnowflake
Categories are used to keep order in a Guild by dividing the channels into groups.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of the specifiedGuildChannel.createCopy(Guild guild) Creates a copy of the specifiedGuildChannelin the specifiedGuild.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 List<GuildChannel>AllChannelslisted for this Category
This may containVoiceChannels,StoreChannels, andTextChannels!Returns theChannelManagerfor this GuildChannel.A List of allMembersthat are in this GuildChannel
ForTextChannels, this returns all Members with thePermission.VIEW_CHANNELPermission.default List<NewsChannel>AllNewsChannelslisted for this Categorydefault List<StageChannel>AllStageChannellisted for this Categorydefault List<StoreChannel>AllStoreChannelslisted for this Categorydefault List<TextChannel>AllTextChannelslisted for this Categorydefault List<VoiceChannel>AllVoiceChannelslisted for this CategoryModifies the positional order of this Category's nestedTextChannelsandStoreChannels.Modifies the positional order of this Category's nestedVoiceChannels.Methods inherited from interface net.dv8tion.jda.api.entities.Channel
formatTo, getAsMention, getJDA, getName, getTypeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.dv8tion.jda.api.entities.GuildChannel
delete, getGuild, getPermissionContainerMethods inherited from interface net.dv8tion.jda.api.entities.IPermissionContainer
createPermissionOverride, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, putPermissionOverride, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.IPositionableChannel
getPosition, getPositionRawMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getChannels
AllChannelslisted for this Category
This may containVoiceChannels,StoreChannels, andTextChannels!- Returns:
- Immutable list of all child channels
-
getStoreChannels
AllStoreChannelslisted for this Category- Returns:
- Immutable list of all child StoreChannels
- Since:
- 4.0.0
-
getTextChannels
AllTextChannelslisted for this Category- Returns:
- Immutable list of all child TextChannels
-
getNewsChannels
AllNewsChannelslisted for this Category- Returns:
- Immutable list of all child NewsChannels
-
getVoiceChannels
AllVoiceChannelslisted for this Category- Returns:
- Immutable list of all child VoiceChannels
-
getStageChannels
AllStageChannellisted for this Category- Returns:
- Immutable list of all child StageChannel
-
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- 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 isnullor empty or greater than 100 characters in length
-
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- 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 isnullor empty or greater than 100 characters in length
-
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- 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 isnullor empty or greater than 100 characters in length
-
modifyTextChannelPositions
Modifies the positional order of this Category's nestedTextChannelsandStoreChannels.
This uses an extension ofChannelOrderActionspecialized for ordering the nestedTextChannelsandStoreChannelsof thisCategory.
LikeChannelOrderAction, the returnedCategoryOrderActioncan be used to move TextChannels/StoreChannelsup,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'sTextChannelsandStoreChannels.
-
modifyVoiceChannelPositions
Modifies the positional order of this Category's nestedVoiceChannels.
This uses an extension ofChannelOrderActionspecialized for ordering the nestedVoiceChannelsof thisCategory.
LikeChannelOrderAction, the returnedCategoryOrderActioncan be used to move VoiceChannelsup,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'sVoiceChannels.
-
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().This is a lazy idempotent getter. The manager is retained after the first call. This getter is not thread-safe and would require guards by the user.
- Specified by:
getManagerin interfaceGuildChannel- Specified by:
getManagerin interfaceIPermissionContainer- Specified by:
getManagerin interfaceIPositionableChannel- Returns:
- The ChannelManager of this GuildChannel
-