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