Interface Channel
- All Superinterfaces:
Formattable, IDetachableEntity, IMentionable, ISnowflake
- All Known Subinterfaces:
AudioChannel, AudioChannelUnion, Category, ChannelUnion, DefaultGuildChannelUnion, ForumChannel, GroupChannel, GuildChannel, GuildChannelUnion, GuildMessageChannel, GuildMessageChannelUnion, IAgeRestrictedChannel, ICategorizableChannel, ICopyableChannel, IInviteContainer, IMemberContainer, IPermissionContainer, IPermissionContainerUnion, IPositionableChannel, IPostContainer, ISlowmodeChannel, ISoundboardSoundChannel, IThreadContainer, IThreadContainerUnion, IVoiceStatusChannel, IWebhookContainer, IWebhookContainerUnion, MediaChannel, MessageChannel, MessageChannelUnion, NewsChannel, PrivateChannel, StageChannel, StandardGuildChannel, StandardGuildMessageChannel, TextChannel, ThreadChannel, VoiceChannel
Abstract Channel interface for all
ChannelTypes.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum length a channel name can be. -
Method Summary
Modifier and TypeMethodDescriptiondelete()Deletes this Channel.default voiddefault StringRetrieve a Mention for this Entity.getFlags()The flags configured for this channel.longThe raw channel flags available for this channel.getJDA()Returns theJDAinstance of this channelReturns the jump-to URL for this channel.getName()The human readable name of this channel.getType()TheChannelTypefor this channeldefault booleanWhether this channel is obfuscated.Methods inherited from interface IDetachableEntity
isDetachedMethods inherited from interface ISnowflake
getId, getIdLong, getTimeCreated
-
Field Details
-
MAX_NAME_LENGTH
static final int MAX_NAME_LENGTHThe maximum length a channel name can be. (100)- See Also:
-
-
Method Details
-
getFlags
The flags configured for this channel.
This feature is currently primarily used forForumChannels.- Returns:
EnumSetof the configuredChannelFlags, changes to this enum set are not reflected in the API.
-
getFlagsRaw
long getFlagsRaw()The raw channel flags available for this channel.For obfuscated channels this will always be
ChannelFlag.OBFUSCATED(1 << 17).- Returns:
- The raw flags for this channel
- See Also:
-
isObfuscated
default boolean isObfuscated()Whether this channel is obfuscated.An obfuscated channel is inaccessible to the logged-in account. It does not provide anything besides positional information. Methods like
getName()will not return the actual name of the channel.Note that channels in interactions are never obfuscated and will instead be detached channels when the channel is otherwise inaccessible.
- Returns:
- True, if this channel is obfuscated.
-
getName
The human readable name of this channel.May be an empty string for
GroupChannelswith no name (Group DMs with no name displays the recipients on the Discord client).- Returns:
- The name of this channel
-
getType
-
getJDA
-
delete
Deletes this Channel.Possible ErrorResponses include:
UNKNOWN_CHANNEL
If this channel was already deleted
- Returns:
RestAction
-
getJumpUrl
Returns the jump-to URL for this channel. Clicking this URL in the Discord client will cause the client to jump to the specified channel.- Returns:
- A String representing the jump-to URL for the channel.
-
getAsMention
Description copied from interface:IMentionableRetrieve a Mention for this Entity. For the publicRole(@everyone), this will return the literal string"@everyone".- Specified by:
getAsMentionin interfaceIMentionable- Returns:
- A resolvable mention.
-
formatTo
- Specified by:
formatToin interfaceFormattable- Specified by:
formatToin interfaceIMentionable
-