diff --git a/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveAllEvent.java b/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveAllEvent.java index 9837cfbefb..5f56ba020f 100644 --- a/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveAllEvent.java +++ b/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveAllEvent.java @@ -17,9 +17,12 @@ package net.dv8tion.jda.api.events.message.react; import net.dv8tion.jda.api.JDA; +import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; import net.dv8tion.jda.api.events.message.GenericMessageEvent; +import net.dv8tion.jda.api.requests.RestAction; +import javax.annotation.CheckReturnValue; import javax.annotation.Nonnull; /** @@ -41,4 +44,21 @@ public MessageReactionRemoveAllEvent(@Nonnull JDA api, long responseNumber, long { super(api, responseNumber, messageId, channel); } + + /** + * Retrieves the message for this reaction event. + *
Simple shortcut for {@code getChannel().retrieveMessageById(getMessageId())}. + * + *

The {@link Message#getMember() Message.getMember()} method will always return null for the resulting message. + * To retrieve the member you can use {@code getGuild().retrieveMember(message.getAuthor())}. + * + * @return {@link RestAction} - Type: {@link Message} + * + */ + @Nonnull + @CheckReturnValue + public RestAction retrieveMessage() + { + return getChannel().retrieveMessageById(getMessageId()); + } } diff --git a/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveEmojiEvent.java b/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveEmojiEvent.java index e69e90cd09..a0182c040d 100644 --- a/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveEmojiEvent.java +++ b/src/main/java/net/dv8tion/jda/api/events/message/react/MessageReactionRemoveEmojiEvent.java @@ -17,12 +17,15 @@ package net.dv8tion.jda.api.events.message.react; import net.dv8tion.jda.api.JDA; +import net.dv8tion.jda.api.entities.Message; import net.dv8tion.jda.api.entities.MessageReaction; import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; import net.dv8tion.jda.api.entities.emoji.Emoji; import net.dv8tion.jda.api.entities.emoji.EmojiUnion; import net.dv8tion.jda.api.events.message.GenericMessageEvent; +import net.dv8tion.jda.api.requests.RestAction; +import javax.annotation.CheckReturnValue; import javax.annotation.Nonnull; /** @@ -70,4 +73,21 @@ public EmojiUnion getEmoji() { return reaction.getEmoji(); } + + /** + * Retrieves the message for this reaction event. + *
Simple shortcut for {@code getChannel().retrieveMessageById(getMessageId())}. + * + *

The {@link Message#getMember() Message.getMember()} method will always return null for the resulting message. + * To retrieve the member you can use {@code getGuild().retrieveMember(message.getAuthor())}. + * + * @return {@link RestAction} - Type: {@link Message} + * + */ + @Nonnull + @CheckReturnValue + public RestAction retrieveMessage() + { + return getChannel().retrieveMessageById(getMessageId()); + } }