Interface AudioChannelUnion
- All Superinterfaces:
AudioChannel
,Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,ICategorizableChannel
,ICopyableChannel
,IInviteContainer
,IMemberContainer
,IMentionable
,IPermissionContainer
,IPositionableChannel
,ISnowflake
,StandardGuildChannel
A union representing all channel types that implement
This class extends
This interface represents the follow concrete channel types:
AudioChannel
.
This class extends
AudioChannel
and primarily acts as a discovery tool for
developers to discover some common interfaces that a AudioChannel
could be cast to.
This interface represents the follow concrete channel types:
-
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 TypeMethodDescriptionCasts this union to aGuildMessageChannel
.Casts this union to aStageChannel
.Casts this union to aVoiceChannel
.Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.AudioChannel
getBitrate, getManager, getRegion, getRegionRaw, getUserLimit
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.ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, getPositionInCategory, isSynced
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IInviteContainer
createInvite, retrieveInvites
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IMemberContainer
getMembers
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
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.StandardGuildChannel
createCopy, createCopy
-
Method Details
-
asVoiceChannel
Casts this union to aVoiceChannel
.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! VoiceChannel channel = union.asVoiceChannel(); VoiceChannel channel2 = (VoiceChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.VOICE
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof VoiceChannel
- Returns:
- The channel as a
VoiceChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aVoiceChannel
.
-
asStageChannel
Casts this union to aStageChannel
.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! StageChannel channel = union.asStageChannel(); StageChannel channel2 = (StageChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.STAGE
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof StageChannel
- Returns:
- The channel as a
StageChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aStageChannel
.
-
asGuildMessageChannel
Casts this union to aGuildMessageChannel
.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! GuildMessageChannel channel = union.asGuildMessageChannel(); GuildMessageChannel channel2 = (GuildMessageChannel) union;
- Returns:
- The channel as a
GuildMessageChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aGuildMessageChannel
.
-