Interface Channel

All Superinterfaces:
Entity, Snowflake, Timestamped
All Known Subinterfaces:
Category, DMChannel, GroupDMChannel, GuildChannel, MessageChannel, NewsChannel, StageChannel, StoreChannel, TextChannel, ThreadChannel, UserDMChannel, VoiceChannel
All Known Implementing Classes:
CategoryImpl, GroupDMChannelImpl, NewsChannelImpl, StageChannelImpl, StoreChannelImpl, TextChannelImpl, ThreadChannelImpl, UserDMChannelImpl, VoiceChannelImpl

public interface Channel extends Snowflake
A Discord channel. A channel may not be attached to a guild (ex. in the case of DMs).
Since:
9/12/18
Author:
natanbc
  • Method Details

    • type

      @Nonnull @CheckReturnValue Channel.ChannelType type()
      Returns:
      The type of this channel.
    • delete

      @Nonnull default io.reactivex.rxjava3.core.Single<Channel> delete(@Nullable String reason)
      Deletes the channel. This operation cannot be undone.
      Parameters:
      reason - The reason that will be displayed in audit log
      Returns:
      A Observable that is completed when the channel is deleted.
    • delete

      @Nonnull default io.reactivex.rxjava3.core.Single<Channel> delete()
      Deletes the channel. This operation cannot be undone.
      Returns:
      A Observable that is completed when the channel is deleted.
    • isText

      @CheckReturnValue default boolean isText()
      Returns:
      Whether or not this channel is a text channel.
    • isVoice

      @CheckReturnValue default boolean isVoice()
      Returns:
      Whether or not this channel is a voice channel.
    • isCategory

      @CheckReturnValue default boolean isCategory()
      Returns:
      Whether or not this channel is a category.
    • isGuild

      @CheckReturnValue default boolean isGuild()
      Returns:
      Whether or not this channel is in a guild.
    • isUserDM

      @CheckReturnValue default boolean isUserDM()
      Returns:
      Whether or not this channel is a DM with a single user.
    • isGroupDM

      @CheckReturnValue default boolean isGroupDM()
      Returns:
      Whether or not this channel is a group DM with at least 1 other user.
    • isDM

      @CheckReturnValue default boolean isDM()
      Returns:
      Whether or not this channel is a DM; see isUserDM() and isGroupDM() for more.
    • isNews

      @CheckReturnValue default boolean isNews()
      Whether or not this channel is a news channel. See discordapp/discord-api-docs#881.
    • isStore

      @CheckReturnValue default boolean isStore()
      Whether or not this channel is a store channel. See discordapp/discord-api-docs#881 and discordapp/discord-api-docs#889.
    • isGuildMessageChannel

      @CheckReturnValue default boolean isGuildMessageChannel()
      Returns:
      Whether or not this channel is part of a guild and can contain messages.
    • asGuildChannel

      @Nonnull @CheckReturnValue default GuildChannel asGuildChannel()
      Returns:
      This channel instance as a GuildChannel.
    • asTextChannel

      @Nonnull @CheckReturnValue default TextChannel asTextChannel()
      Returns:
      This channel instance as a TextChannel.
    • asVoiceChannel

      @Nonnull @CheckReturnValue default VoiceChannel asVoiceChannel()
      Returns:
      This channel instance as a VoiceChannel.
    • asCategory

      @Nonnull @CheckReturnValue default Category asCategory()
      Returns:
      This channel instance as a Category.
    • asDMChannel

      @Nonnull @CheckReturnValue default DMChannel asDMChannel()
      Returns:
      This channel instance as a DMChannel.
    • asUserDMChannel

      @Nonnull @CheckReturnValue default UserDMChannel asUserDMChannel()
      Returns:
      This channel instance as a UserDMChannel.
    • asGroupDMChannel

      @Nonnull @CheckReturnValue default GroupDMChannel asGroupDMChannel()
      Returns:
      This channel instance as a GroupDMChannel.
    • asMessageChannel

      @Nonnull @CheckReturnValue default MessageChannel asMessageChannel()