Class AbstractChannelImpl<T extends AbstractChannelImpl<T>>
- All Implemented Interfaces:
Formattable
,Channel
,ChannelUnion
,IDetachableEntity
,IMentionable
,ISnowflake
,ChannelMixin<T>
,IDetachableEntityMixin
- Direct Known Subclasses:
AbstractGuildChannelImpl
,DetachedGroupChannelImpl
,DetachedPrivateChannelImpl
,PrivateChannelImpl
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCasts this union to aAudioChannel
.Casts this union to aCategory
.Casts this union to aForumChannel
.Casts this union to aGroupChannel
.Casts this union to aGuildChannel
.Casts this union to aGuildMessageChannel
.Casts this union to aMediaChannel
.Casts this union to aMessageChannel
.Casts this union to aNewsChannel
.Casts this union to aPrivateChannel
.Casts this union to aStageChannel
.Casts this union to aStandardGuildChannel
.Casts this union to aStandardGuildMessageChannel
.Casts this union to aTextChannel
.Casts this union to aThreadChannel
.Casts this union to aIThreadContainer
.Casts this union to aVoiceChannel
.long
The Snowflake id of this entity.getJDA()
Returns theJDA
instance of this channelgetName()
The human readable name of this channel.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.Channel
formatTo, getAsMention, getFlags, getType
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.ChannelMixin
checkCanAccess, delete
Methods inherited from interface net.dv8tion.jda.api.entities.detached.IDetachableEntity
isDetached
Methods inherited from interface net.dv8tion.jda.internal.entities.detached.mixin.IDetachableEntityMixin
checkAttached, detachedException, detachedRequiresChannelException
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
AbstractChannelImpl
-
-
Method Details
-
getJDA
Description copied from interface:Channel
Returns theJDA
instance of this channel -
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getName
Description copied from interface:Channel
The human readable name of this channel.May be an empty string for
GroupChannels
with no name (Group DMs with no name displays the recipients on the Discord client). -
setName
- Specified by:
setName
in interfaceChannelMixin<T extends AbstractChannelImpl<T>>
-
asPrivateChannel
Description copied from interface:ChannelUnion
Casts this union to aPrivateChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! PrivateChannel channel = union.asPrivateChannel(); PrivateChannel channel2 = (PrivateChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.PRIVATE
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof PrivateChannel
- Specified by:
asPrivateChannel
in interfaceChannelUnion
- Returns:
- The channel as a
PrivateChannel
-
asGroupChannel
Description copied from interface:ChannelUnion
Casts this union to aGroupChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! GroupChannel channel = union.asGroupChannel(); GroupChannel channel2 = (GroupChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.GROUP
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof GroupChannel
- Specified by:
asGroupChannel
in interfaceChannelUnion
- Returns:
- The channel as a
GroupChannel
-
asTextChannel
Description copied from interface:ChannelUnion
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
- Specified by:
asTextChannel
in interfaceChannelUnion
- Returns:
- The channel as a
TextChannel
-
asNewsChannel
Description copied from interface:ChannelUnion
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
- Specified by:
asNewsChannel
in interfaceChannelUnion
- Returns:
- The channel as a
NewsChannel
-
asVoiceChannel
Description copied from interface:ChannelUnion
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
- Specified by:
asVoiceChannel
in interfaceChannelUnion
- Returns:
- The channel as a
VoiceChannel
-
asStageChannel
Description copied from interface:ChannelUnion
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
- Specified by:
asStageChannel
in interfaceChannelUnion
- Returns:
- The channel as a
StageChannel
-
asThreadChannel
Description copied from interface:ChannelUnion
Casts this union to aThreadChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! ThreadChannel channel = union.asThreadChannel(); ThreadChannel channel2 = (ThreadChannel) union;
Channel.getType()
.isThread()
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof ThreadChannel
- Specified by:
asThreadChannel
in interfaceChannelUnion
- Returns:
- The channel as a
ThreadChannel
-
asCategory
Description copied from interface:ChannelUnion
Casts this union to aCategory
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! Category channel = union.asCategory(); Category channel2 = (Category) union;
Channel.getType()
to see if the channel is of typeChannelType.CATEGORY
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof Category
- Specified by:
asCategory
in interfaceChannelUnion
- Returns:
- The channel as a
Category
-
asForumChannel
Description copied from interface:ChannelUnion
Casts this union to aForumChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! ForumChannel channel = union.asForumChannel(); ForumChannel channel2 = (ForumChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.FORUM
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof ForumChannel
- Specified by:
asForumChannel
in interfaceChannelUnion
- Returns:
- The channel as a
ForumChannel
-
asMediaChannel
Description copied from interface:ChannelUnion
Casts this union to aMediaChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! MediaChannel channel = union.asMediaChannel(); MediaChannel channel2 = (MediaChannel) union;
Channel.getType()
to see if the channel is of typeChannelType.MEDIA
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof MediaChannel
- Specified by:
asMediaChannel
in interfaceChannelUnion
- Returns:
- The channel as a
MediaChannel
-
asMessageChannel
Description copied from interface:ChannelUnion
Casts this union to aMessageChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! MessageChannel channel = union.asMessageChannel(); MessageChannel channel2 = (MessageChannel) union;
Channel.getType()
.isMessage()
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof MessageChannel
- Specified by:
asMessageChannel
in interfaceChannelUnion
- Returns:
- The channel as a
MessageChannel
-
asAudioChannel
Description copied from interface:ChannelUnion
Casts this union to aAudioChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! AudioChannel channel = union.asAudioChannel(); AudioChannel channel2 = (AudioChannel) union;
Channel.getType()
.isAudio()
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof AudioChannel
- Specified by:
asAudioChannel
in interfaceChannelUnion
- Returns:
- The channel as a
AudioChannel
-
asThreadContainer
Description copied from interface:ChannelUnion
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.- Specified by:
asThreadContainer
in interfaceChannelUnion
- Returns:
- The channel as a
IThreadContainer
-
asGuildChannel
Description copied from interface:ChannelUnion
Casts this union to aGuildChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! GuildChannel channel = union.asGuildChannel(); GuildChannel channel2 = (GuildChannel) union;
Channel.getType()
isGuild()
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof GuildChannel
- Specified by:
asGuildChannel
in interfaceChannelUnion
- Returns:
- The channel as a
GuildChannel
-
asGuildMessageChannel
Description copied from interface:ChannelUnion
Casts this union to aGuildMessageChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! GuildMessageChannel channel = union.asGuildMessageChannel(); GuildMessageChannel channel2 = (GuildMessageChannel) union;
Channel.getType()
.isGuild()
andChannel.getType()
.isMessage()
to validate whether you can call this method in addition to normal instanceof checks:channel instanceof GuildMessageChannel
- Specified by:
asGuildMessageChannel
in interfaceChannelUnion
- Returns:
- The channel as a
GuildMessageChannel
-
asStandardGuildChannel
Description copied from interface:ChannelUnion
Casts this union to aStandardGuildChannel
. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! StandardGuildChannel channel = union.asStandardGuildChannel(); StandardGuildChannel channel2 = (StandardGuildChannel) union;
- Specified by:
asStandardGuildChannel
in interfaceChannelUnion
- Returns:
- The channel as a
StandardGuildChannel
-
asStandardGuildMessageChannel
Description copied from interface:ChannelUnion
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;
- Specified by:
asStandardGuildMessageChannel
in interfaceChannelUnion
- Returns:
- The channel as a
StandardGuildMessageChannel
-
toString
-