Interface DefaultGuildChannelUnion
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,ICategorizableChannel
,ICopyableChannel
,IInviteContainer
,IMemberContainer
,IMentionable
,IPermissionContainer
,IPositionableChannel
,ISnowflake
,StandardGuildChannel
A specialized union representing all channel types that can be used for the "default" channel for
This is the channel that the Discord client will default to opening when a Guild is opened for the first time when accepting an invite that is not directed at a specific
This class extends
Guild.getDefaultChannel()
or Member.getDefaultChannel()
.
This is the channel that the Discord client will default to opening when a Guild is opened for the first time when accepting an invite that is not directed at a specific
channel
.
This class extends
StandardGuildChannel
and primarily acts as a discovery tool for
developers to understand which channels might be returned as default channels.
Not all StandardGuildChannel
channels can be used as a default channel!
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 aNewsChannel
.Casts this union to aStandardGuildMessageChannel
.Casts this union to aTextChannel
.Casts this union to aIThreadContainer
.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, getManager
-
Method Details
-
asTextChannel
Casts this union to aTextChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! TextChannel channel = union.asTextChannel(); TextChannel channel2 = (TextChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.TEXT
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof TextChannel
- Returns:
- The channel as a
TextChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aTextChannel
.
-
asNewsChannel
Casts this union to aNewsChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! NewsChannel channel = union.asNewsChannel(); NewsChannel channel2 = (NewsChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.NEWS
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof NewsChannel
- Returns:
- The channel as a
NewsChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aNewsChannel
.
-
asThreadContainer
Casts this union to aIThreadContainer
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! IThreadContainer channel = union.asThreadContainer(); IThreadContainer channel2 = (IThreadContainer) union;
channel instanceof IThreadContainer
to validate whether you can call this method.- Returns:
- The channel as a
IThreadContainer
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aIThreadContainer
.
-
asStandardGuildMessageChannel
Casts this union to aStandardGuildMessageChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! StandardGuildMessageChannel channel = union.asStandardGuildMessageChannel(); StandardGuildMessageChannel channel2 = (StandardGuildMessageChannel) union;
- Returns:
- The channel as a
StandardGuildMessageChannel
- Throws:
IllegalStateException
- If the channel represented by this union is not actually aStandardGuildMessageChannel
.
-