Class ReactionAddEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.message.MessageEvent
-
- discord4j.core.event.domain.message.ReactionAddEvent
-
public class ReactionAddEvent extends MessageEvent
Dispatched when a reaction is added to a message.guildId
may not be present if the message was in a private channel.This event is dispatched by Discord.
- See Also:
- Message Reaction Add
-
-
Constructor Summary
Constructors Constructor Description ReactionAddEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long userId, long channelId, long messageId, Long guildId, ReactionEmoji emoji, Member member)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<MessageChannel>
getChannel()
Requests to retrieve theMessageChannel
theMessage
and reaction are in.Snowflake
getChannelId()
ReactionEmoji
getEmoji()
Gets theReactionEmoji
that was added to theMessage
in this event.Mono<Guild>
getGuild()
Optional<Snowflake>
getGuildId()
Optional<Member>
getMember()
Gets the member who reacted, if present.Mono<Message>
getMessage()
Request to retrieve theMessage
the reaction was added to in this event.Snowflake
getMessageId()
Mono<User>
getUser()
Requests to retrieve theUser
who added a reaction in this event.Snowflake
getUserId()
String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
ReactionAddEvent
public ReactionAddEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long userId, long channelId, long messageId, @Nullable Long guildId, ReactionEmoji emoji, @Nullable Member member)
-
-
Method Detail
-
getUser
public Mono<User> getUser()
Requests to retrieve theUser
who added a reaction in this event.
-
getChannelId
public Snowflake getChannelId()
- Returns:
- The ID of the
MessageChannel
involved.
-
getChannel
public Mono<MessageChannel> getChannel()
Requests to retrieve theMessageChannel
theMessage
and reaction are in.- Returns:
- A
Mono
where, upon successful completion, emits theMessageChannel
containing theMessage
in the event. If an error is received, it is emitted through theMono
.
-
getMessageId
public Snowflake getMessageId()
- Returns:
- The ID of the
Message
the reaction was added to.
-
getMessage
public Mono<Message> getMessage()
Request to retrieve theMessage
the reaction was added to in this event.
-
getGuildId
public Optional<Snowflake> getGuildId()
Gets theSnowflake
ID of theGuild
containing theMessage
and Reaction, if present. This may not be available if the reaction is to aMessage
in a private channel.- Returns:
- The ID of the
Guild
involved in the event, if present.
-
getEmoji
public ReactionEmoji getEmoji()
Gets theReactionEmoji
that was added to theMessage
in this event.- Returns:
- The
Emoji
added to theMessage
as a reaction.
-
getMember
public Optional<Member> getMember()
Gets the member who reacted, if present. This may not be available if the reaction is to aMessage
in a private channel.- Returns:
- The member who reacted, if present.
-
-