Package net.dv8tion.jda.api.entities
Interface IPositionableChannel
-
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,IMentionable
,ISnowflake
- All Known Subinterfaces:
BaseGuildMessageChannel
,Category
,NewsChannel
,StageChannel
,StoreChannel
,TextChannel
,VoiceChannel
public interface IPositionableChannel extends GuildChannel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IPositionableChannelManager<?,?>
getManager()
Returns theChannelManager
for this GuildChannel.default int
getPosition()
The position this GuildChannel is displayed at.int
getPositionRaw()
The actual position of theGuildChannel
as stored and given by Discord.-
Methods inherited from interface net.dv8tion.jda.api.entities.Channel
formatTo, getAsMention, getJDA, getName, getType
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface net.dv8tion.jda.api.entities.GuildChannel
delete, getGuild, getPermissionContainer
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
-
-
-
Method Detail
-
getManager
@Nonnull IPositionableChannelManager<?,?> 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()
.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:
getManager
in interfaceGuildChannel
- Returns:
- The ChannelManager of this GuildChannel
-
getPosition
default int getPosition()
The position this GuildChannel is displayed at.
Higher values mean they are displayed lower in the Client. Position 0 is the top most GuildChannel Channels of aGuild
do not have to have continuous positions- Returns:
- Zero-based int of position of the GuildChannel.
- Throws:
IllegalStateException
- If this channel is not in the guild cache
-
getPositionRaw
int getPositionRaw()
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 bygetPosition()
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.- Returns:
- The true, Discord stored, position of the
GuildChannel
.
-
-