Package org.javacord.api.event.message
Interface MessageEvent
-
- All Superinterfaces:
ChannelEvent,Event,TextChannelEvent
- All Known Subinterfaces:
CachedMessagePinEvent,CachedMessageUnpinEvent,CertainMessageEvent,MessageCreateEvent,MessageDeleteEvent,MessageEditEvent,MessageReplyEvent,OptionalMessageEvent,ReactionAddEvent,ReactionEvent,ReactionRemoveAllEvent,ReactionRemoveEvent,RequestableMessageEvent,SingleReactionEvent
public interface MessageEvent extends TextChannelEvent
A message event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>addReactionsToMessage(java.lang.String... unicodeEmojis)Adds unicode reactions to the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>addReactionsToMessage(Emoji... emojis)Adds reactions to the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>addReactionToMessage(java.lang.String unicodeEmoji)Adds a unicode reaction to the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>addReactionToMessage(Emoji emoji)Adds a reaction to the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>deleteMessage()Deletes the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>deleteMessage(java.lang.String reason)Deletes the message involved in the event.java.util.concurrent.CompletableFuture<Message>editMessage(java.lang.String content)Updates the content of the message involved in the event.java.util.concurrent.CompletableFuture<Message>editMessage(java.lang.String content, java.util.List<EmbedBuilder> embeds)Updates the content and the embeds of the message involved in the event.default java.util.concurrent.CompletableFuture<Message>editMessage(java.lang.String content, EmbedBuilder... embeds)Updates the content and the embeds of the message involved in the event.java.util.concurrent.CompletableFuture<Message>editMessage(java.util.List<EmbedBuilder> embeds)Updates the embeds of the message involved in the event.default java.util.concurrent.CompletableFuture<Message>editMessage(EmbedBuilder... embeds)Updates the embeds of the message involved in the event.longgetMessageId()Gets the id of the message.java.util.Optional<Server>getServer()Gets the server of the message.java.util.concurrent.CompletableFuture<java.lang.Void>pinMessage()Pins the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>removeAllReactionsFromMessage()Deletes all reactions on the message involved in the event.java.util.concurrent.CompletableFuture<java.lang.Void>removeOwnReactionByEmojiFromMessage(java.lang.String unicodeEmoji)Removes you from the list of reactors of a given unicode emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeOwnReactionByEmojiFromMessage(Emoji emoji)Removes you from the list of reactors of a given emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeOwnReactionsByEmojiFromMessage(java.lang.String... unicodeEmojis)Removes you from the list of reactors of the given unicode emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeOwnReactionsByEmojiFromMessage(Emoji... emojis)Removes you from the list of reactors of the given emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionByEmojiFromMessage(java.lang.String unicodeEmoji)Removes all reactors of a given unicode emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionByEmojiFromMessage(Emoji emoji)Removes all reactors of a given emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionByEmojiFromMessage(User user, java.lang.String unicodeEmoji)Removes a user from the list of reactors of a given unicode emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionByEmojiFromMessage(User user, Emoji emoji)Removes a user from the list of reactors of a given emoji reaction from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionsByEmojiFromMessage(java.lang.String... unicodeEmojis)Removes all reactors of the given unicode emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionsByEmojiFromMessage(Emoji... emojis)Removes all reactors of the given emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionsByEmojiFromMessage(User user, java.lang.String... unicodeEmojis)Removes a user from the list of reactors of the given unicode emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>removeReactionsByEmojiFromMessage(User user, Emoji... emojis)Removes a user from the list of reactors of the given emoji reactions from the message.java.util.concurrent.CompletableFuture<java.lang.Void>unpinMessage()Unpins the message involved in the event.-
Methods inherited from interface org.javacord.api.event.channel.TextChannelEvent
getChannel, getPrivateChannel, getServerTextChannel, getServerThreadChannel
-
-
-
-
Method Detail
-
getMessageId
long getMessageId()
Gets the id of the message.- Returns:
- The id of the message.
-
getServer
java.util.Optional<Server> getServer()
Gets the server of the message.- Returns:
- The server of the message.
-
deleteMessage
java.util.concurrent.CompletableFuture<java.lang.Void> deleteMessage()
Deletes the message involved in the event.- Returns:
- A future to tell us if the deletion was successful.
-
deleteMessage
java.util.concurrent.CompletableFuture<java.lang.Void> deleteMessage(java.lang.String reason)
Deletes the message involved in the event.- Parameters:
reason- The audit log reason for the deletion.- Returns:
- A future to tell us if the deletion was successful.
-
editMessage
java.util.concurrent.CompletableFuture<Message> editMessage(java.lang.String content)
Updates the content of the message involved in the event.- Parameters:
content- The new content of the message.- Returns:
- A future to check if the update was successful.
-
editMessage
default java.util.concurrent.CompletableFuture<Message> editMessage(EmbedBuilder... embeds)
Updates the embeds of the message involved in the event.- Parameters:
embeds- An array of the new embeds of the message.- Returns:
- A future to check if the update was successful.
-
editMessage
java.util.concurrent.CompletableFuture<Message> editMessage(java.util.List<EmbedBuilder> embeds)
Updates the embeds of the message involved in the event.- Parameters:
embeds- A list of the new embeds of the message.- Returns:
- A future to check if the update was successful.
-
editMessage
default java.util.concurrent.CompletableFuture<Message> editMessage(java.lang.String content, EmbedBuilder... embeds)
Updates the content and the embeds of the message involved in the event.- Parameters:
content- The new content of the message.embeds- An array of the new embeds of the message.- Returns:
- A future to check if the update was successful.
-
editMessage
java.util.concurrent.CompletableFuture<Message> editMessage(java.lang.String content, java.util.List<EmbedBuilder> embeds)
Updates the content and the embeds of the message involved in the event.- Parameters:
content- The new content of the message.embeds- An array of the new embeds of the message.- Returns:
- A future to check if the update was successful.
-
addReactionToMessage
java.util.concurrent.CompletableFuture<java.lang.Void> addReactionToMessage(java.lang.String unicodeEmoji)
Adds a unicode reaction to the message involved in the event.- Parameters:
unicodeEmoji- The unicode emoji string.- Returns:
- A future to tell us if the action was successful.
-
addReactionToMessage
java.util.concurrent.CompletableFuture<java.lang.Void> addReactionToMessage(Emoji emoji)
Adds a reaction to the message involved in the event.- Parameters:
emoji- The emoji.- Returns:
- A future to tell us if the action was successful.
-
addReactionsToMessage
java.util.concurrent.CompletableFuture<java.lang.Void> addReactionsToMessage(Emoji... emojis)
Adds reactions to the message involved in the event.- Parameters:
emojis- The emojis.- Returns:
- A future to tell us if the action was successful.
-
addReactionsToMessage
java.util.concurrent.CompletableFuture<java.lang.Void> addReactionsToMessage(java.lang.String... unicodeEmojis)
Adds unicode reactions to the message involved in the event.- Parameters:
unicodeEmojis- The unicode emoji strings.- Returns:
- A future to tell us if the action was successful.
-
removeAllReactionsFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeAllReactionsFromMessage()
Deletes all reactions on the message involved in the event.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionByEmojiFromMessage(User user, Emoji emoji)
Removes a user from the list of reactors of a given emoji reaction from the message.- Parameters:
user- The user to remove.emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionByEmojiFromMessage(User user, java.lang.String unicodeEmoji)
Removes a user from the list of reactors of a given unicode emoji reaction from the message.- Parameters:
user- The user to remove.unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionByEmojiFromMessage(Emoji emoji)
Removes all reactors of a given emoji reaction from the message.- Parameters:
emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionByEmojiFromMessage(java.lang.String unicodeEmoji)
Removes all reactors of a given unicode emoji reaction from the message.- Parameters:
unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionsByEmojiFromMessage(User user, Emoji... emojis)
Removes a user from the list of reactors of the given emoji reactions from the message.- Parameters:
user- The user to remove.emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionsByEmojiFromMessage(User user, java.lang.String... unicodeEmojis)
Removes a user from the list of reactors of the given unicode emoji reactions from the message.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.user- The user to remove.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionsByEmojiFromMessage(Emoji... emojis)
Removes all reactors of the given emoji reactions from the message.- Parameters:
emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeReactionsByEmojiFromMessage(java.lang.String... unicodeEmojis)
Removes all reactors of the given unicode emoji reactions from the message.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeOwnReactionByEmojiFromMessage(Emoji emoji)
Removes you from the list of reactors of a given emoji reaction from the message.- Parameters:
emoji- The emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeOwnReactionByEmojiFromMessage(java.lang.String unicodeEmoji)
Removes you from the list of reactors of a given unicode emoji reaction from the message.- Parameters:
unicodeEmoji- The unicode emoji of the reaction.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeOwnReactionsByEmojiFromMessage(Emoji... emojis)
Removes you from the list of reactors of the given emoji reactions from the message.- Parameters:
emojis- The emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
removeOwnReactionsByEmojiFromMessage
java.util.concurrent.CompletableFuture<java.lang.Void> removeOwnReactionsByEmojiFromMessage(java.lang.String... unicodeEmojis)
Removes you from the list of reactors of the given unicode emoji reactions from the message.- Parameters:
unicodeEmojis- The unicode emojis of the reactions.- Returns:
- A future to tell us if the deletion was successful.
-
pinMessage
java.util.concurrent.CompletableFuture<java.lang.Void> pinMessage()
Pins the message involved in the event.- Returns:
- A future to tell us if the pin was successful.
-
unpinMessage
java.util.concurrent.CompletableFuture<java.lang.Void> unpinMessage()
Unpins the message involved in the event.- Returns:
- A future to tell us if the action was successful.
-
-