Interface MessageChannel

All Superinterfaces:
Channel, Entity, Snowflake, Timestamped
All Known Subinterfaces:
DMChannel, GroupDMChannel, NewsChannel, StageChannel, TextChannel, ThreadChannel, UserDMChannel, VoiceChannel
All Known Implementing Classes:
GroupDMChannelImpl, NewsChannelImpl, StageChannelImpl, TextChannelImpl, ThreadChannelImpl, UserDMChannelImpl, VoiceChannelImpl

public interface MessageChannel extends Channel
A channel that can have messages sent in it.
Since:
9/12/18
Author:
natanbc
  • Method Details

    • sendMessage

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

      @Nonnull default io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull Embed embed)
      Send a message to this channel with the specified embed.
      Parameters:
      embed - The embed to send
      Returns:
      A Observable that completes when the message is sent.
    • sendMessage

      @Nonnull default io.reactivex.rxjava3.core.Single<Message> sendMessage(@Nonnull Message message)
      Send a message to this channel.
      Parameters:
      message - The message to send.
      Returns:
      A Observable that completes when the message is sent.
    • sendMessage

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

      @Nonnull default io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull String content)
      Edit the message with the given id in this channel to contain the specified content.
      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 default io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull Embed embed)
      Edit the message with the given id in this channel to contain the specified embed.
      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 default io.reactivex.rxjava3.core.Single<Message> editMessage(@Nonnull String messageId, @Nonnull Message message)
      Edit the message with the given id in this channel to contain the content and embed of the given message.
      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 default io.reactivex.rxjava3.core.Completable deleteMessage(@Nonnull String messageId, @Nullable String reason)
      Delete the message with the given id in this channel.
      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 default io.reactivex.rxjava3.core.Completable deleteMessage(@Nonnull String messageId)
      Delete the message with the given id in this channel.
      Parameters:
      messageId - The id of the message to delete.
      Returns:
      A Observable that completes when the message is deleted.
    • addReaction

      @Nonnull default io.reactivex.rxjava3.core.Completable addReaction(@Nonnull String messageId, @Nonnull String emoji)
      Add a reaction to the message with the given id in this channel.
      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 default io.reactivex.rxjava3.core.Completable addReaction(@Nonnull String messageId, @Nonnull Emoji emoji)
      Add a reaction to the message with the given id in this channel.
      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 default io.reactivex.rxjava3.core.Completable deleteOwnReaction(@Nonnull String messageId, @Nonnull String emoji)
      Delete your own reaction on the given message.
      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 default io.reactivex.rxjava3.core.Completable deleteOwnReaction(@Nonnull String messageId, @Nonnull Emoji emoji)
      Delete your own reaction on the given message.
      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 default io.reactivex.rxjava3.core.Completable deleteUserReaction(@Nonnull String messageId, @Nonnull String userId, @Nonnull String emoji)
      Delete a user's reaction on the given message.
      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 default io.reactivex.rxjava3.core.Completable deleteUserReaction(@Nonnull String messageId, @Nonnull String userId, @Nonnull Emoji emoji)
      Delete a user's reaction on the given message.
      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 default io.reactivex.rxjava3.core.Completable bulkRemoveReaction(@Nonnull String messageId)
      Delete all reactions on the given message
      Parameters:
      messageId - The id of the message to remove all reactions from.
      Returns:
      A Observable that completes when the reaction is removed.
    • triggerTypingIndicator

      @Nonnull default io.reactivex.rxjava3.core.Completable triggerTypingIndicator()
      Trigger the "[user] is typing..." indicator for yourself in this channel.
      Returns:
      A Observable that completes when the typing indicator is triggered.
    • fetchMessage

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

      @Nonnull @CheckReturnValue default MessagePaginator fetchMessages()
      Fetch the history for the channel in a paginated way.
      Returns:
      The paginator for channel history.