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.guildIdmay 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 theMessageChanneltheMessageand reaction are in.SnowflakegetChannelId()ReactionEmojigetEmoji()Gets theReactionEmojithat was added to theMessagein this event.Mono<Guild>getGuild()Optional<Snowflake>getGuildId()Optional<Member>getMember()Gets the member who reacted, if present.Mono<Message>getMessage()Request to retrieve theMessagethe reaction was added to in this event.SnowflakegetMessageId()Mono<User>getUser()Requests to retrieve theUserwho added a reaction in this event.SnowflakegetUserId()StringtoString()-
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 theUserwho added a reaction in this event.
-
getChannelId
public Snowflake getChannelId()
- Returns:
- The ID of the
MessageChannelinvolved.
-
getChannel
public Mono<MessageChannel> getChannel()
Requests to retrieve theMessageChanneltheMessageand reaction are in.- Returns:
- A
Monowhere, upon successful completion, emits theMessageChannelcontaining theMessagein the event. If an error is received, it is emitted through theMono.
-
getMessageId
public Snowflake getMessageId()
- Returns:
- The ID of the
Messagethe reaction was added to.
-
getMessage
public Mono<Message> getMessage()
Request to retrieve theMessagethe reaction was added to in this event.
-
getGuildId
public Optional<Snowflake> getGuildId()
Gets theSnowflakeID of theGuildcontaining theMessageand Reaction, if present. This may not be available if the reaction is to aMessagein a private channel.- Returns:
- The ID of the
Guildinvolved in the event, if present.
-
getEmoji
public ReactionEmoji getEmoji()
Gets theReactionEmojithat was added to theMessagein this event.- Returns:
- The
Emojiadded to theMessageas a reaction.
-
getMember
public Optional<Member> getMember()
Gets the member who reacted, if present. This may not be available if the reaction is to aMessagein a private channel.- Returns:
- The member who reacted, if present.
-
-