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.
- 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_LENGTH
Fields 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 specifiedGuildChannel
in the specifiedGuild
.createForumChannel
(String name) Creates a newForumChannel
with this Category as parent.createMediaChannel
(String name) Creates a newMediaChannel
with this Category as parent.createNewsChannel
(String name) Creates a newNewsChannel
with this Category as parent.createStageChannel
(String name) Creates a newStageChannel
with this Category as parent.createTextChannel
(String name) Creates a newTextChannel
with this Category as parent.createVoiceChannel
(String name) Creates a newVoiceChannel
with this Category as parent.default @Unmodifiable List<GuildChannel>
AllChannels
listed for this Category.default @Unmodifiable List<ForumChannel>
AllForumChannels
listed for this CategoryReturns theChannelManager
for this GuildChannel.default @Unmodifiable List<MediaChannel>
AllMediaChannels
listed for this CategoryA List of allMembers
that are in this GuildChannel
ForTextChannels
, this returns all Members with thePermission.VIEW_CHANNEL
Permission.default @Unmodifiable List<NewsChannel>
AllNewsChannels
listed for this Categorydefault @Unmodifiable List<StageChannel>
AllStageChannel
listed for this Categorydefault @Unmodifiable List<TextChannel>
AllTextChannels
listed for this Categorydefault @Unmodifiable List<VoiceChannel>
AllVoiceChannels
listed for this CategoryModifies the positional order of this Category's nestedTextChannels
andNewsChannels
.Modifies the positional order of this Category's nestedVoiceChannels
andStageChannels
.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getType
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainer
getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverride
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPositionableChannel
getPosition, getPositionRaw
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getChannels
AllChannels
listed for this Category.
Includes all types of channels, except for threads.- Returns:
- Immutable list of all child channels
-
getTextChannels
AllTextChannels
listed for this Category- Returns:
- Immutable list of all child TextChannels
-
getNewsChannels
AllNewsChannels
listed for this Category- Returns:
- Immutable list of all child NewsChannels
-
getForumChannels
AllForumChannels
listed for this Category- Returns:
- Immutable list of all child ForumChannels
-
getMediaChannels
AllMediaChannels
listed for this Category- Returns:
- Immutable list of all child ForumChannels
-
getVoiceChannels
AllVoiceChannels
listed for this Category- Returns:
- Immutable list of all child VoiceChannels
-
getStageChannels
AllStageChannel
listed for this Category- Returns:
- Immutable list of all child StageChannel
-
createTextChannel
Creates a newTextChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
createNewsChannel
Creates a newNewsChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
createVoiceChannel
Creates a newVoiceChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
createStageChannel
Creates a newStageChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
createForumChannel
Creates a newForumChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
createMediaChannel
Creates a newMediaChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in this Category.This will copy all
PermissionOverrides
of this Category! Unless the bot is unable to sync it with this category due to permission escalation. SeeIPermissionHolder.canSync(IPermissionContainer, IPermissionContainer)
for details.Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission 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_CHANNEL
permissionIllegalArgumentException
- If the provided name isnull
, empty, or longer than 100 characters
-
modifyTextChannelPositions
Modifies the positional order of this Category's nestedTextChannels
andNewsChannels
.
This uses an extension ofChannelOrderAction
specialized for ordering the nestedTextChannels
andNewsChannels
of thisCategory
.
LikeChannelOrderAction
, the returnedCategoryOrderAction
can be used to move TextChannels/NewsChannelsup
,down
, orto
a specific position.
This uses ascending order with a 0 based index.Possible
ErrorResponses
include: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
CategoryOrderAction
for ordering the Category'sTextChannels
andNewsChannels
.
-
modifyVoiceChannelPositions
Modifies the positional order of this Category's nestedVoiceChannels
andStageChannels
.
This uses an extension ofChannelOrderAction
specialized for ordering the nestedVoiceChannels
andStageChannels
of thisCategory
.
LikeChannelOrderAction
, the returnedCategoryOrderAction
can be used to move VoiceChannels/StageChannelsup
,down
, orto
a specific position.
This uses ascending order with a 0 based index.Possible
ErrorResponses
include: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
CategoryOrderAction
for ordering the Category'sVoiceChannels
andStageChannels
.
-
getMembers
Description copied from interface:IMemberContainer
A List of allMembers
that are in this GuildChannel
ForTextChannels
, this returns all Members with thePermission.VIEW_CHANNEL
Permission.
ForVoiceChannels
, this returns all Members that joined that VoiceChannel.
ForCategories
, this returns all Members who are in its child channels.- Specified by:
getMembers
in interfaceIMemberContainer
- Returns:
- An immutable List of
Members
that are in this GuildChannel.
-
createCopy
Description copied from interface:ICopyableChannel
Creates a copy of the specifiedGuildChannel
in 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
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission was removed
- Specified by:
createCopy
in interfaceICopyableChannel
- Parameters:
guild
- TheGuild
to 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:ICopyableChannel
Creates 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
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission was removed
- Specified by:
createCopy
in interfaceICopyableChannel
- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
getManager
Description copied from interface:GuildChannel
Returns theChannelManager
for 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:
getManager
in interfaceGuildChannel
- Specified by:
getManager
in interfaceIPermissionContainer
- Specified by:
getManager
in interfaceIPositionableChannel
- Returns:
- The ChannelManager of this GuildChannel
-