Package net.dv8tion.jda.core.entities
Interface Category
-
- All Superinterfaces:
Channel
,java.lang.Comparable<Category>
,ISnowflake
public interface Category extends Channel, java.lang.Comparable<Category>
Represents a channel category in the official Discord API.
Categories are used to keep order in a Guild by dividing the channels into groups.- Since:
- 3.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelAction
createTextChannel(java.lang.String name)
Creates a newTextChannel
with this Category as parent.ChannelAction
createVoiceChannel(java.lang.String name)
Creates a newVoiceChannel
with this Category as parent.java.util.List<Channel>
getChannels()
java.util.List<TextChannel>
getTextChannels()
AllTextChannels
listed for this Categoryjava.util.List<VoiceChannel>
getVoiceChannels()
AllVoiceChannels
listed for this CategoryCategoryOrderAction<TextChannel>
modifyTextChannelPositions()
Modifies the positional order of this Category's nestedTextChannels
.CategoryOrderAction<VoiceChannel>
modifyVoiceChannelPositions()
Modifies the positional order of this Category's nestedVoiceChannels
.-
Methods inherited from interface net.dv8tion.jda.core.entities.Channel
createCopy, createCopy, createInvite, createPermissionOverride, createPermissionOverride, delete, getGuild, getInvites, getJDA, getManager, getMemberPermissionOverrides, getMembers, getName, getParent, getPermissionOverride, getPermissionOverride, getPermissionOverrides, getPosition, getPositionRaw, getRolePermissionOverrides, getType, putPermissionOverride, putPermissionOverride
-
Methods inherited from interface net.dv8tion.jda.core.entities.ISnowflake
getCreationTime, getId, getIdLong
-
-
-
-
Method Detail
-
getChannels
java.util.List<Channel> getChannels()
- Returns:
- Immutable list of all child channels
-
getTextChannels
java.util.List<TextChannel> getTextChannels()
AllTextChannels
listed for this Category- Returns:
- Immutable list of all child TextChannels
-
getVoiceChannels
java.util.List<VoiceChannel> getVoiceChannels()
AllVoiceChannels
listed for this Category- Returns:
- Immutable list of all child VoiceChannels
-
createTextChannel
@CheckReturnValue ChannelAction createTextChannel(java.lang.String name)
Creates a newTextChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in theGuild
.This will copy all
PermissionOverrides
of this Category!Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
We were removed from the Guild before finishing the task
- 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_CHANNEL
permissionjava.lang.IllegalArgumentException
- If the provided name isnull
or empty or greater than 100 characters in length
-
createVoiceChannel
@CheckReturnValue ChannelAction createVoiceChannel(java.lang.String name)
Creates a newVoiceChannel
with this Category as parent. For this to be successful, the logged in account has to have theMANAGE_CHANNEL
Permission in theGuild
.This will copy all
PermissionOverrides
of this Category!Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
We were removed from the Guild before finishing the task
- 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_CHANNEL
permissionjava.lang.IllegalArgumentException
- If the provided name isnull
or empty or greater than 100 characters in length
-
modifyTextChannelPositions
@CheckReturnValue CategoryOrderAction<TextChannel> modifyTextChannelPositions()
Modifies the positional order of this Category's nestedTextChannels
.
This uses an extension ofChannelOrderAction
specialized for ordering the nestedTextChannels
of thisCategory
.
LikeChannelOrderAction
, the returnedCategoryOrderAction
can be used to move TextChannelsup
,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
.
-
modifyVoiceChannelPositions
@CheckReturnValue CategoryOrderAction<VoiceChannel> modifyVoiceChannelPositions()
Modifies the positional order of this Category's nestedVoiceChannels
.
This uses an extension ofChannelOrderAction
specialized for ordering the nestedVoiceChannels
of thisCategory
.
LikeChannelOrderAction
, the returnedCategoryOrderAction
can be used to move VoiceChannelsup
,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
.
-
-