Package net.dv8tion.jda.api.entities
Enum ChannelType
- java.lang.Object
-
- java.lang.Enum<ChannelType>
-
- net.dv8tion.jda.api.entities.ChannelType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ChannelType>
public enum ChannelType extends java.lang.Enum<ChannelType>
Enum used to differentiate between the different types of Discord channels.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CATEGORYACategory, Guild-Only.GROUPA Group.PRIVATESTAGEAStageChannel, Guild-Only.STOREAStoreChannel, Guild-Only.TEXTATextChannel, Guild-Only.UNKNOWNUnknown Discord channel type.VOICEAVoiceChannel, Guild-Only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChannelTypefromId(int id)Static accessor for retrieving a channel type based on its Discord id key.static java.util.EnumSet<ChannelType>fromSortBucket(int bucket)AnEnumSetpopulated with all channel types using the provided sorting bucket.intgetId()The Discord id key used to represent the channel type.intgetSortBucket()The sorting bucket for this channel type.booleanisAudio()Whether channels of this type support audio connections.booleanisGuild()Whether this ChannelType is present for aGuildChannelbooleanisMessage()Whether channels of this type support message sending.static ChannelTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ChannelType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TEXT
public static final ChannelType TEXT
ATextChannel, Guild-Only.
-
PRIVATE
public static final ChannelType PRIVATE
-
VOICE
public static final ChannelType VOICE
AVoiceChannel, Guild-Only.
-
GROUP
public static final ChannelType GROUP
A Group. (unused)
-
CATEGORY
public static final ChannelType CATEGORY
ACategory, Guild-Only.
-
STORE
public static final ChannelType STORE
AStoreChannel, Guild-Only.
-
STAGE
public static final ChannelType STAGE
AStageChannel, Guild-Only.
-
UNKNOWN
public static final ChannelType UNKNOWN
Unknown Discord channel type. Should never happen and would only possibly happen if Discord implemented a new channel type and JDA had yet to implement support for it.
-
-
Method Detail
-
values
public static ChannelType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ChannelType c : ChannelType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ChannelType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getSortBucket
public int getSortBucket()
The sorting bucket for this channel type.- Returns:
- The sorting bucket
-
getId
public int getId()
The Discord id key used to represent the channel type.- Returns:
- The id key used by discord for this channel type.
-
isGuild
public boolean isGuild()
Whether this ChannelType is present for aGuildChannel- Returns:
- Whether or not this a GuildChannel
-
isAudio
public boolean isAudio()
Whether channels of this type support audio connections.- Returns:
- True, if channels of this type support audio
-
isMessage
public boolean isMessage()
Whether channels of this type support message sending.- Returns:
- True, if channels of this type support messages
-
fromId
@Nonnull public static ChannelType fromId(int id)
Static accessor for retrieving a channel type based on its Discord id key.- Parameters:
id- The id key of the requested channel type.- Returns:
- The ChannelType that is referred to by the provided key. If the id key is unknown,
UNKNOWNis returned.
-
fromSortBucket
@Nonnull public static java.util.EnumSet<ChannelType> fromSortBucket(int bucket)
AnEnumSetpopulated with all channel types using the provided sorting bucket.- Parameters:
bucket- The sorting bucket- Returns:
- Possibly-empty
EnumSetfor the bucket
-
-