Class StageChannelImpl

java.lang.Object
com.mewna.catnip.entity.impl.channel.StageChannelImpl
All Implemented Interfaces:
Channel, GuildChannel, MessageChannel, StageChannel, TextChannel, VoiceChannel, Entity, GuildEntity, HasGuild, HasName, HasParentChannel, Mentionable, Snowflake, Timestamped, RequiresCatnip

public class StageChannelImpl extends Object implements StageChannel, RequiresCatnip
Since:
11/26/21.
Author:
amy
  • Constructor Details

    • StageChannelImpl

      public StageChannelImpl()
    • StageChannelImpl

      public StageChannelImpl(Catnip catnip, long idAsLong, String name, long guildIdAsLong, int position, long parentIdAsLong, List<PermissionOverride> overrides, int bitrate, int userLimit)
  • Method Details

    • catnip

      public void catnip(@Nonnull Catnip catnip)
      Specified by:
      catnip in interface RequiresCatnip
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • sendMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull String content)
      Description copied from interface: MessageChannel
      Send a message to this channel with the specified content.
      Specified by:
      sendMessage in interface MessageChannel
      Parameters:
      content - The text content to send.
      Returns:
      A Observable that completes when the message is sent.
    • sendMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull Embed embed)
      Description copied from interface: MessageChannel
      Send a message to this channel with the specified embed.
      Specified by:
      sendMessage in interface MessageChannel
      Parameters:
      embed - The embed to send
      Returns:
      A Observable that completes when the message is sent.
    • sendMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull Message message)
      Description copied from interface: MessageChannel
      Send a message to this channel.
      Specified by:
      sendMessage in interface MessageChannel
      Parameters:
      message - The message to send.
      Returns:
      A Observable that completes when the message is sent.
    • sendMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull MessageOptions options)
      Description copied from interface: MessageChannel
      Send a message to this channel with the specified options.
      Specified by:
      sendMessage in interface MessageChannel
      Parameters:
      options - The options for the message being sent.
      Returns:
      A Observable that completes when the message is sent.
    • editMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull String content)
      Description copied from interface: MessageChannel
      Edit the message with the given id in this channel to contain the specified content.
      Specified by:
      editMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to edit.
      content - The new content to set on the message.
      Returns:
      A Observable that completes when the message is edited.
    • editMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull Embed embed)
      Description copied from interface: MessageChannel
      Edit the message with the given id in this channel to contain the specified embed.
      Specified by:
      editMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to edit.
      embed - The new embed to be set on the message.
      Returns:
      A Observable that completes when the message is edited.
    • editMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull Message message)
      Description copied from interface: MessageChannel
      Edit the message with the given id in this channel to contain the content and embed of the given message.
      Specified by:
      editMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to edit.
      message - The message to set as the new message.
      Returns:
      A Observable that completes when the message is edited.
    • deleteMessage

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteMessage(@Nonnull String messageId, @Nullable String reason)
      Description copied from interface: MessageChannel
      Delete the message with the given id in this channel.
      Specified by:
      deleteMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to delete.
      reason - The reason that will be displayed in audit log
      Returns:
      A Observable that completes when the message is deleted.
    • deleteMessage

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteMessage(@Nonnull String messageId)
      Description copied from interface: MessageChannel
      Delete the message with the given id in this channel.
      Specified by:
      deleteMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to delete.
      Returns:
      A Observable that completes when the message is deleted.
    • addReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable addReaction(@Nonnull String messageId, @Nonnull String emoji)
      Description copied from interface: MessageChannel
      Add a reaction to the message with the given id in this channel.
      Specified by:
      addReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to add a reaction to.
      emoji - The reaction to add.
      Returns:
      A Observable that completes when the reaction is added.
    • addReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable addReaction(@Nonnull String messageId, @Nonnull Emoji emoji)
      Description copied from interface: MessageChannel
      Add a reaction to the message with the given id in this channel.
      Specified by:
      addReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to add a reaction to.
      emoji - The reaction to add.
      Returns:
      A Observable that completes when the reaction is added.
    • deleteOwnReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteOwnReaction(@Nonnull String messageId, @Nonnull String emoji)
      Description copied from interface: MessageChannel
      Delete your own reaction on the given message.
      Specified by:
      deleteOwnReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to remove a reaction from.
      emoji - The reaction to remove.
      Returns:
      A Observable that completes when the reaction is removed.
    • deleteOwnReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteOwnReaction(@Nonnull String messageId, @Nonnull Emoji emoji)
      Description copied from interface: MessageChannel
      Delete your own reaction on the given message.
      Specified by:
      deleteOwnReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to remove a reaction from.
      emoji - The reaction to remove.
      Returns:
      A Observable that completes when the reaction is removed.
    • deleteUserReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteUserReaction(@Nonnull String messageId, @Nonnull String userId, @Nonnull String emoji)
      Description copied from interface: MessageChannel
      Delete a user's reaction on the given message.
      Specified by:
      deleteUserReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to remove a reaction from.
      userId - The id of the user whose reaction is to be removed.
      emoji - The reaction to remove.
      Returns:
      A Observable that completes when the reaction is removed.
    • deleteUserReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable deleteUserReaction(@Nonnull String messageId, @Nonnull String userId, @Nonnull Emoji emoji)
      Description copied from interface: MessageChannel
      Delete a user's reaction on the given message.
      Specified by:
      deleteUserReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to remove a reaction from.
      userId - The id of the user whose reaction is to be removed.
      emoji - The reaction to remove.
      Returns:
      A Observable that completes when the reaction is removed.
    • bulkRemoveReaction

      @Nonnull public io.reactivex.rxjava3.core.Completable bulkRemoveReaction(@Nonnull String messageId)
      Description copied from interface: MessageChannel
      Delete all reactions on the given message
      Specified by:
      bulkRemoveReaction in interface MessageChannel
      Parameters:
      messageId - The id of the message to remove all reactions from.
      Returns:
      A Observable that completes when the reaction is removed.
    • triggerTypingIndicator

      @Nonnull public io.reactivex.rxjava3.core.Completable triggerTypingIndicator()
      Description copied from interface: MessageChannel
      Trigger the "[user] is typing..." indicator for yourself in this channel.
      Specified by:
      triggerTypingIndicator in interface MessageChannel
      Returns:
      A Observable that completes when the typing indicator is triggered.
    • fetchMessage

      @Nonnull public io.reactivex.rxjava3.core.Single<Message> fetchMessage(@Nonnull String messageId)
      Description copied from interface: MessageChannel
      Fetch the message with the given id from this channel.
      Specified by:
      fetchMessage in interface MessageChannel
      Parameters:
      messageId - The id of the message to fetch.
      Returns:
      A Observable that completes when the message is fetched.
    • fetchMessages

      @Nonnull public MessagePaginator fetchMessages()
      Description copied from interface: MessageChannel
      Fetch the history for the channel in a paginated way.
      Specified by:
      fetchMessages in interface MessageChannel
      Returns:
      The paginator for channel history.
    • fetchWebhooks

      @Nonnull public io.reactivex.rxjava3.core.Observable<Webhook> fetchWebhooks()
      Description copied from interface: TextChannel
      Fetch all webhooks on this channel.
      Specified by:
      fetchWebhooks in interface TextChannel
      Returns:
      A not-null, possibly-empty list of webhooks for this channel.
    • isGuildMessageChannel

      public boolean isGuildMessageChannel()
      Specified by:
      isGuildMessageChannel in interface Channel
      Returns:
      Whether or not this channel is part of a guild and can contain messages.
    • builder

    • type

      public Channel.ChannelType type()
      Specified by:
      type in interface Channel
      Specified by:
      type in interface StageChannel
      Returns:
      The type of this channel.
    • catnip

      public Catnip catnip()
      Description copied from interface: Entity
      Returns the catnip instance associated with this entity.
      Specified by:
      catnip in interface Entity
      Returns:
      The catnip instance of this entity.
    • idAsLong

      public long idAsLong()
      Description copied from interface: Snowflake
      The ID of this snowflake, as a long.
      Specified by:
      idAsLong in interface Snowflake
      Returns:
      Long representing the ID.
    • name

      public String name()
      Specified by:
      name in interface HasName
    • guildIdAsLong

      public long guildIdAsLong()
      Description copied from interface: HasGuild
      The id of the guild this entity is from.
      Specified by:
      guildIdAsLong in interface HasGuild
      Returns:
      Long representing the guild ID.
    • position

      public int position()
      Specified by:
      position in interface GuildChannel
      Returns:
      The position of the channel.
    • parentIdAsLong

      public long parentIdAsLong()
      Specified by:
      parentIdAsLong in interface HasParentChannel
      Returns:
      The id of the Category that is the parent of this channel. A value of 0 means no parent.
    • overrides

      public List<PermissionOverride> overrides()
      Specified by:
      overrides in interface GuildChannel
      Returns:
      The permission overrides set on this channel. Will never be null, but may be empty.
    • bitrate

      public int bitrate()
      Specified by:
      bitrate in interface VoiceChannel
      Returns:
      The bitrate of this channel. Will be from 8 to 96.
    • userLimit

      public int userLimit()
      Specified by:
      userLimit in interface VoiceChannel
      Returns:
      The maximum number of users allowed in this voice channel at once.
    • idAsLong

      public StageChannelImpl idAsLong(long idAsLong)
      Returns:
      this.
    • name

      public StageChannelImpl name(String name)
      Returns:
      this.
    • guildIdAsLong

      public StageChannelImpl guildIdAsLong(long guildIdAsLong)
      Returns:
      this.
    • position

      public StageChannelImpl position(int position)
      Returns:
      this.
    • parentIdAsLong

      public StageChannelImpl parentIdAsLong(long parentIdAsLong)
      Returns:
      this.
    • overrides

      public StageChannelImpl overrides(List<PermissionOverride> overrides)
      Returns:
      this.
    • bitrate

      public StageChannelImpl bitrate(int bitrate)
      Returns:
      this.
    • userLimit

      public StageChannelImpl userLimit(int userLimit)
      Returns:
      this.