Package org.javacord.api.entity.message
Interface UncachedMessageUtil
-
- All Superinterfaces:
UncachedMessageAttachableListenerManager
public interface UncachedMessageUtil extends UncachedMessageAttachableListenerManager
This class provides methods to interact with messages without having an instance of it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletableFuture<Void>addReaction(long channelId, long messageId, String unicodeEmoji)Adds a unicode reaction to the message.CompletableFuture<Void>addReaction(long channelId, long messageId, Emoji emoji)Adds a reaction to the message.CompletableFuture<Void>addReaction(String channelId, String messageId, String unicodeEmoji)Adds a unicode reaction to the message.CompletableFuture<Void>addReaction(String channelId, String messageId, Emoji emoji)Adds a reaction to the message.default CompletableFuture<Message>crossPost(long channelId, long messageId)Cross posts the message if it is in a announcement channel.CompletableFuture<Message>crossPost(String channelId, String messageId)Cross posts the message if it is in a announcement channel.CompletableFuture<Void>delete(long channelId, long messageId)Deletes the message.CompletableFuture<Void>delete(long channelId, long... messageIds)Deletes multiple messages at once.CompletableFuture<Void>delete(long channelId, long messageId, String reason)Deletes the message.CompletableFuture<Void>delete(Iterable<Message> messages)Deletes multiple messages at once.CompletableFuture<Void>delete(String channelId, String messageId)Deletes the message.CompletableFuture<Void>delete(String channelId, String... messageIds)Deletes multiple messages at once.CompletableFuture<Void>delete(String channelId, String messageId, String reason)Deletes the message.CompletableFuture<Void>delete(Message... messages)Deletes multiple messages at once.CompletableFuture<Message>edit(long channelId, long messageId, String content)Updates the content of the message.CompletableFuture<Message>edit(long channelId, long messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)Updates the content and the embed of the message.CompletableFuture<Message>edit(long channelId, long messageId, String content, EmbedBuilder embed)Updates the content and the embed of the message.CompletableFuture<Message>edit(long channelId, long messageId, EmbedBuilder embed)Updates the embed of the message.CompletableFuture<Message>edit(String channelId, String messageId, String content)Updates the content of the message.CompletableFuture<Message>edit(String channelId, String messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)Updates the content and the embed of the message.CompletableFuture<Message>edit(String channelId, String messageId, String content, EmbedBuilder embed)Updates the content and the embed of the message.CompletableFuture<Message>edit(String channelId, String messageId, EmbedBuilder embed)Updates the embed of the message.CompletableFuture<List<User>>getUsersWhoReactedWithEmoji(long channelId, long messageId, Emoji emoji)Gets a list with all users who reacted with the given emoji.CompletableFuture<List<User>>getUsersWhoReactedWithEmoji(String channelId, String messageId, Emoji emoji)Gets a list with all users who reacted with the given emoji.CompletableFuture<Void>pin(long channelId, long messageId)Pins this message.CompletableFuture<Void>pin(String channelId, String messageId)Pins this message.CompletableFuture<Void>removeAllReactions(long channelId, long messageId)Deletes all reactions on this message.CompletableFuture<Void>removeAllReactions(String channelId, String messageId)Deletes all reactions on this message.CompletableFuture<Message>removeContent(long channelId, long messageId)Removes the content of the message.CompletableFuture<Message>removeContent(String channelId, String messageId)Removes the content of the message.CompletableFuture<Message>removeContentAndEmbed(long channelId, long messageId)Removes the content and embed of the message.CompletableFuture<Message>removeContentAndEmbed(String channelId, String messageId)Removes the content and embed of the message.CompletableFuture<Message>removeEmbed(long channelId, long messageId)Removes the embed of the message.CompletableFuture<Message>removeEmbed(String channelId, String messageId)Removes the embed of the message.CompletableFuture<Void>removeUserReactionByEmoji(long channelId, long messageId, Emoji emoji, long userId)Removes the reaction of the given user.CompletableFuture<Void>removeUserReactionByEmoji(String channelId, String messageId, Emoji emoji, String userId)Removes the reaction of the given user.CompletableFuture<Void>unpin(long channelId, long messageId)Unpins this message.CompletableFuture<Void>unpin(String channelId, String messageId)Unpins this message.-
Methods inherited from interface org.javacord.api.listener.message.UncachedMessageAttachableListenerManager
addMessageAttachableListener, addMessageAttachableListener, addMessageDeleteListener, addMessageEditListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveListener, getMessageAttachableListeners, getMessageAttachableListeners, getMessageDeleteListeners, getMessageDeleteListeners, getMessageEditListeners, getMessageEditListeners, getReactionAddListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getReactionRemoveListeners, removeListener, removeListener, removeMessageAttachableListener, removeMessageAttachableListener
-
-
-
-
Method Detail
-
crossPost
default CompletableFuture<Message> crossPost(long channelId, long messageId)
Cross posts the message if it is in a announcement channel.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- The new message object.
-
crossPost
CompletableFuture<Message> crossPost(String channelId, String messageId)
Cross posts the message if it is in a announcement channel.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- The new message object.
-
delete
CompletableFuture<Void> delete(long channelId, long messageId)
Deletes the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(String channelId, String messageId)
Deletes the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(long channelId, long messageId, String reason)
Deletes the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(String channelId, String messageId, String reason)
Deletes the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(long channelId, long... messageIds)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
channelId- The id of the message's channel.messageIds- The ids of the messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(String channelId, String... messageIds)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
channelId- The id of the message's channel.messageIds- The ids of the messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(Message... messages)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
messages- The messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
delete
CompletableFuture<Void> delete(Iterable<Message> messages)
Deletes multiple messages at once. This method does not have a size or age restriction. Messages younger than two weeks are sent in batches of 100 messages to the bulk delete API, older messages are deleted with individual delete requests.- Parameters:
messages- The messages to delete.- Returns:
- A future to tell us if the deletion was successful.
-
edit
CompletableFuture<Message> edit(long channelId, long messageId, String content)
Updates the content of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(String channelId, String messageId, String content)
Updates the content of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(long channelId, long messageId, EmbedBuilder embed)
Updates the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(String channelId, String messageId, EmbedBuilder embed)
Updates the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(long channelId, long messageId, String content, EmbedBuilder embed)
Updates the content and the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(String channelId, String messageId, String content, EmbedBuilder embed)
Updates the content and the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.embed- The new embed of the message.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(long channelId, long messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)
Updates the content and the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.updateContent- Whether to update or remove the content.embed- The new embed of the message.updateEmbed- Whether to update or remove the embed.- Returns:
- A future to check if the update was successful.
-
edit
CompletableFuture<Message> edit(String channelId, String messageId, String content, boolean updateContent, EmbedBuilder embed, boolean updateEmbed)
Updates the content and the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.content- The new content of the message.updateContent- Whether to update or remove the content.embed- The new embed of the message.updateEmbed- Whether to update or remove the embed.- Returns:
- A future to check if the update was successful.
-
removeContent
CompletableFuture<Message> removeContent(long channelId, long messageId)
Removes the content of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContent
CompletableFuture<Message> removeContent(String channelId, String messageId)
Removes the content of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeEmbed
CompletableFuture<Message> removeEmbed(long channelId, long messageId)
Removes the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeEmbed
CompletableFuture<Message> removeEmbed(String channelId, String messageId)
Removes the embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContentAndEmbed
CompletableFuture<Message> removeContentAndEmbed(long channelId, long messageId)
Removes the content and embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
removeContentAndEmbed
CompletableFuture<Message> removeContentAndEmbed(String channelId, String messageId)
Removes the content and embed of the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to check if the removal was successful.
-
addReaction
CompletableFuture<Void> addReaction(long channelId, long messageId, String unicodeEmoji)
Adds a unicode reaction to the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReaction
CompletableFuture<Void> addReaction(String channelId, String messageId, String unicodeEmoji)
Adds a unicode reaction to the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReaction
CompletableFuture<Void> addReaction(long channelId, long messageId, Emoji emoji)
Adds a reaction to the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
addReaction
CompletableFuture<Void> addReaction(String channelId, String messageId, Emoji emoji)
Adds a reaction to the message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
removeAllReactions
CompletableFuture<Void> removeAllReactions(long channelId, long messageId)
Deletes all reactions on this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
removeAllReactions
CompletableFuture<Void> removeAllReactions(String channelId, String messageId)
Deletes all reactions on this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the deletion was successful.
-
pin
CompletableFuture<Void> pin(long channelId, long messageId)
Pins this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the pin was successful.
-
pin
CompletableFuture<Void> pin(String channelId, String messageId)
Pins this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the pin was successful.
-
unpin
CompletableFuture<Void> unpin(long channelId, long messageId)
Unpins this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the action was successful.
-
unpin
CompletableFuture<Void> unpin(String channelId, String messageId)
Unpins this message.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.- Returns:
- A future to tell us if the action was successful.
-
getUsersWhoReactedWithEmoji
CompletableFuture<List<User>> getUsersWhoReactedWithEmoji(long channelId, long messageId, Emoji emoji)
Gets a list with all users who reacted with the given emoji.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.- Returns:
- A list with all users who reacted with the given emoji
-
getUsersWhoReactedWithEmoji
CompletableFuture<List<User>> getUsersWhoReactedWithEmoji(String channelId, String messageId, Emoji emoji)
Gets a list with all users who reacted with the given emoji.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.- Returns:
- A list with all users who reacted with the given emoji
-
removeUserReactionByEmoji
CompletableFuture<Void> removeUserReactionByEmoji(long channelId, long messageId, Emoji emoji, long userId)
Removes the reaction of the given user.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.userId- The id of the user to remove.- Returns:
- A future to tell us if the action was successful.
-
removeUserReactionByEmoji
CompletableFuture<Void> removeUserReactionByEmoji(String channelId, String messageId, Emoji emoji, String userId)
Removes the reaction of the given user.- Parameters:
channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.userId- The id of the user to remove.- Returns:
- A future to tell us if the action was successful.
-
-