Package com.mewna.catnip.entity.channel
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
A channel that can have messages sent in it.
- Since:
- 9/12/18
- Author:
- natanbc
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.channel.Channel
Channel.ChannelType
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.reactivex.rxjava3.core.Completable
addReaction
(String messageId, Emoji emoji) Add a reaction to the message with the given id in this channel.default io.reactivex.rxjava3.core.Completable
addReaction
(String messageId, String emoji) Add a reaction to the message with the given id in this channel.default io.reactivex.rxjava3.core.Completable
bulkRemoveReaction
(String messageId) Delete all reactions on the given messagedefault io.reactivex.rxjava3.core.Completable
deleteMessage
(String messageId) Delete the message with the given id in this channel.default io.reactivex.rxjava3.core.Completable
deleteMessage
(String messageId, String reason) Delete the message with the given id in this channel.default io.reactivex.rxjava3.core.Completable
deleteOwnReaction
(String messageId, Emoji emoji) Delete your own reaction on the given message.default io.reactivex.rxjava3.core.Completable
deleteOwnReaction
(String messageId, String emoji) Delete your own reaction on the given message.default io.reactivex.rxjava3.core.Completable
deleteUserReaction
(String messageId, String userId, Emoji emoji) Delete a user's reaction on the given message.default io.reactivex.rxjava3.core.Completable
deleteUserReaction
(String messageId, String userId, String emoji) Delete a user's reaction on the given message.default io.reactivex.rxjava3.core.Single<Message>
editMessage
(String messageId, Embed embed) Edit the message with the given id in this channel to contain the specified embed.default io.reactivex.rxjava3.core.Single<Message>
editMessage
(String messageId, Message message) Edit the message with the given id in this channel to contain the content and embed of the given message.default io.reactivex.rxjava3.core.Single<Message>
editMessage
(String messageId, String content) Edit the message with the given id in this channel to contain the specified content.default io.reactivex.rxjava3.core.Single<Message>
fetchMessage
(String messageId) Fetch the message with the given id from this channel.default MessagePaginator
Fetch the history for the channel in a paginated way.default io.reactivex.rxjava3.core.Single<Message>
sendMessage
(Embed embed) Send a message to this channel with the specified embed.default io.reactivex.rxjava3.core.Single<Message>
sendMessage
(Message message) Send a message to this channel.default io.reactivex.rxjava3.core.Single<Message>
sendMessage
(MessageOptions options) Send a message to this channel with the specified options.default io.reactivex.rxjava3.core.Single<Message>
sendMessage
(String content) Send a message to this channel with the specified content.default io.reactivex.rxjava3.core.Completable
Trigger the "[user] is typing..." indicator for yourself in this channel.Methods inherited from interface com.mewna.catnip.entity.channel.Channel
asCategory, asDMChannel, asGroupDMChannel, asGuildChannel, asMessageChannel, asTextChannel, asUserDMChannel, asVoiceChannel, delete, delete, isCategory, isDM, isGroupDM, isGuild, isGuildMessageChannel, isNews, isStore, isText, isUserDM, isVoice, type
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
sendMessage
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
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
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
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
Fetch the history for the channel in a paginated way.- Returns:
- The paginator for channel history.
-