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, IThreadContainer, IThreadContainerUnion, IVoiceStatusChannel, IWebhookContainer, IWebhookContainerUnion, MediaChannel, MessageChannel, MessageChannelUnion, NewsChannel, PrivateChannel, StageChannel, StandardGuildChannel, StandardGuildMessageChannel, TextChannel, ThreadChannel, VoiceChannel

public interface Channel extends IMentionable, IDetachableEntity
Abstract Channel interface for all ChannelTypes.
  • Field Details

    • MAX_NAME_LENGTH

      static final int MAX_NAME_LENGTH
      The maximum length a channel name can be. (100)
      See Also:
  • Method Details

    • getFlags

      @Nonnull default EnumSet<ChannelFlag> getFlags()
      The flags configured for this channel.
      This feature is currently primarily used for ForumChannels.
      Returns:
      EnumSet of the configured ChannelFlags, changes to this enum set are not reflected in the API.
    • getName

      @Nonnull String getName()
      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).

      Returns:
      The name of this channel
    • getType

      @Nonnull ChannelType getType()
      The ChannelType for this channel
      Returns:
      The channel type
    • getJDA

      @Nonnull JDA getJDA()
      Returns the JDA instance of this channel
      Returns:
      the corresponding JDA instance
    • delete

      @Nonnull @CheckReturnValue RestAction<Void> delete()
      Deletes this Channel.

      Possible ErrorResponses include:

      Returns:
      RestAction
    • getAsMention

      @Nonnull default String getAsMention()
      Description copied from interface: IMentionable
      Retrieve a Mention for this Entity. For the public Role (@everyone), this will return the literal string "@everyone".
      Specified by:
      getAsMention in interface IMentionable
      Returns:
      A resolvable mention.
    • formatTo

      default void formatTo(Formatter formatter, int flags, int width, int precision)
      Specified by:
      formatTo in interface Formattable
      Specified by:
      formatTo in interface IMentionable