Class CategoryImpl
- All Implemented Interfaces:
Comparable<GuildChannel>
,Formattable
,ICopyableChannel
,IMemberContainer
,IPermissionContainer
,IPositionableChannel
,Channel
,Category
,GuildChannel
,ChannelUnion
,GuildChannelUnion
,IPermissionContainerUnion
,IDetachableEntity
,IMentionable
,ISnowflake
,IPermissionContainerMixin<CategoryImpl>
,IPositionableChannelMixin<CategoryImpl>
,ChannelMixin<CategoryImpl>
,CategoryMixin<CategoryImpl>
,GuildChannelMixin<CategoryImpl>
,IDetachableEntityMixin
-
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of the specifiedGuildChannel
.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.getGuild()
Returns theGuild
that this GuildChannel is part of.Returns theChannelManager
for this GuildChannel.gnu.trove.map.TLongObjectMap
<PermissionOverride> int
The actual position of theGuildChannel
as stored and given by Discord.getType()
TheChannelType
for this channelboolean
Whether this entity is detached.Modifies the positional order of this Category's nestedTextChannels
andNewsChannels
.Modifies the positional order of this Category's nestedVoiceChannels
andStageChannels
.setPosition
(int position) Methods inherited from class net.dv8tion.jda.internal.entities.channel.middleman.AbstractGuildChannelImpl
compareTo
Methods inherited from class net.dv8tion.jda.internal.entities.channel.AbstractChannelImpl
asAudioChannel, asCategory, asForumChannel, asGroupChannel, asGuildChannel, asGuildMessageChannel, asMediaChannel, asMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel, getIdLong, getJDA, getName, setName, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.entities.channel.concrete.Category
getChannels, getForumChannels, getMediaChannels, getMembers, getNewsChannels, getStageChannels, getTextChannels, getVoiceChannels
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.concrete.CategoryMixin
createCopy
Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.ChannelMixin
delete, setName
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.ChannelUnion
asAudioChannel, asCategory, asForumChannel, asGroupChannel, asGuildChannel, asGuildMessageChannel, asMediaChannel, asMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
getJumpUrl
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.middleman.GuildChannelMixin
checkCanAccess, checkCanManage, checkPermission, checkPermission, delete, hasPermission
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.GuildChannelUnion
asAudioChannel, asCategory, asForumChannel, asGuildMessageChannel, asMediaChannel, asNewsChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.internal.entities.detached.mixin.IDetachableEntityMixin
checkAttached, detachedException, detachedRequiresChannelException
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainer
getMemberPermissionOverrides, getRolePermissionOverrides
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.attribute.IPermissionContainerMixin
getPermissionContainer, getPermissionOverride, getPermissionOverrides, upsertPermissionOverride
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.IPermissionContainerUnion
asAudioChannel, asCategory, asForumChannel, asGuildMessageChannel, asNewsChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPositionableChannel
getPosition
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Constructor Details
-
CategoryImpl
-
-
Method Details
-
isDetached
public boolean isDetached()Description copied from interface:IDetachableEntity
Whether this entity is detached.If this returns
true
, this entity cannot be retrieved, will never be updated, and most methods that would otherwise return aRestAction
will throw aDetachedEntityException
instead.- Specified by:
isDetached
in interfaceIDetachableEntity
- Returns:
True
, if the entity is detached
-
getGuild
Description copied from interface:GuildChannel
Returns theGuild
that this GuildChannel is part of.- Specified by:
getGuild
in interfaceGuildChannel
- Overrides:
getGuild
in classAbstractGuildChannelImpl<CategoryImpl>
- Returns:
- Never-null
Guild
that this GuildChannel is part of.
-
getType
Description copied from interface:Channel
TheChannelType
for this channel -
getPositionRaw
public int getPositionRaw()Description copied from interface:IPositionableChannel
The actual position of theGuildChannel
as stored and given by Discord.Channel positions are actually based on a pairing of the creation time (as stored in the snowflake id) and the position. If 2 or more channels share the same position then they are sorted based on their creation date. The more recent a channel was created, the lower it is in the hierarchy. This is handled by
IPositionableChannel.getPosition()
and it is most likely the method you want. If, for some reason, you want the actual position of the channel then this method will give you that value.- Specified by:
getPositionRaw
in interfaceIPositionableChannel
- Returns:
- The true, Discord stored, position of the
GuildChannel
.
-
createTextChannel
Description copied from interface:Category
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
- Specified by:
createTextChannel
in interfaceCategory
- 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
-
createNewsChannel
Description copied from interface:Category
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
- Specified by:
createNewsChannel
in interfaceCategory
- 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
-
createVoiceChannel
Description copied from interface:Category
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
- Specified by:
createVoiceChannel
in interfaceCategory
- 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
-
createStageChannel
Description copied from interface:Category
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
- Specified by:
createStageChannel
in interfaceCategory
- 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
-
createForumChannel
Description copied from interface:Category
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
- Specified by:
createForumChannel
in interfaceCategory
- 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
-
createMediaChannel
Description copied from interface:Category
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
- Specified by:
createMediaChannel
in interfaceCategory
- 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
-
modifyTextChannelPositions
Description copied from interface:Category
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.
- Specified by:
modifyTextChannelPositions
in interfaceCategory
- Returns:
- A
CategoryOrderAction
for ordering the Category'sTextChannels
andNewsChannels
.
-
modifyVoiceChannelPositions
Description copied from interface:Category
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.
- Specified by:
modifyVoiceChannelPositions
in interfaceCategory
- Returns:
- A
CategoryOrderAction
for ordering the Category'sVoiceChannels
andStageChannels
.
-
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 interfaceCategory
- 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 interfaceCategory
- Specified by:
getManager
in interfaceGuildChannel
- Specified by:
getManager
in interfaceIPermissionContainer
- Specified by:
getManager
in interfaceIPositionableChannel
- Returns:
- The ChannelManager of this GuildChannel
-
getPermissionOverrideMap
- Specified by:
getPermissionOverrideMap
in interfaceIPermissionContainerMixin<CategoryImpl>
-
setPosition
- Specified by:
setPosition
in interfaceIPositionableChannelMixin<CategoryImpl>
-