Class GenericMessageReactionEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.message.GenericMessageEvent
-
- net.dv8tion.jda.api.events.message.react.GenericMessageReactionEvent
-
- All Implemented Interfaces:
GenericEvent
- Direct Known Subclasses:
MessageReactionAddEvent
,MessageReactionRemoveEvent
public class GenericMessageReactionEvent extends GenericMessageEvent
Indicates that a MessageReaction was added/removed.
Every MessageReactionEvent is derived from this event and can be casted.Can be used to detect both remove and add events.
-
-
Constructor Summary
Constructors Constructor Description GenericMessageReactionEvent(JDA api, long responseNumber, User user, MessageReaction reaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Member
getMember()
TheMember
instance for the reacting user ornull
if the reaction was from a user not in this guild.MessageReaction
getReaction()
TheMessageReaction
MessageReaction.ReactionEmote
getReactionEmote()
TheReactionEmote
of the reaction, shortcut forgetReaction().getReactionEmote()
User
getUser()
The reactingUser
-
Methods inherited from class net.dv8tion.jda.api.events.message.GenericMessageEvent
getChannel, getChannelType, getGuild, getMessageId, getMessageIdLong, getPrivateChannel, getTextChannel, isFromGuild, isFromType
-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Method Detail
-
getMember
@Nullable public Member getMember()
TheMember
instance for the reacting user ornull
if the reaction was from a user not in this guild.- Returns:
- Member of the reacting user or null if they are no longer member of this guild
- Throws:
IllegalStateException
- If this was not sent in aTextChannel
.- See Also:
GenericMessageEvent.isFromGuild()
,GenericMessageEvent.getChannelType()
-
getReaction
@Nonnull public MessageReaction getReaction()
TheMessageReaction
- Returns:
- The MessageReaction
-
getReactionEmote
@Nonnull public MessageReaction.ReactionEmote getReactionEmote()
TheReactionEmote
of the reaction, shortcut forgetReaction().getReactionEmote()
- Returns:
- The ReactionEmote instance
-
-