Package discord4j.core.object.reaction
Class Reaction
- java.lang.Object
-
- discord4j.core.object.reaction.Reaction
-
- All Implemented Interfaces:
DiscordObject
public final class Reaction extends Object implements DiscordObject
A Discord message reaction.- See Also:
- Reaction Object
-
-
Constructor Summary
Constructors Constructor Description Reaction(GatewayDiscordClient gateway, discord4j.discordjson.json.ReactionData data)Constructs aReactionwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.intgetCount()Gets the number of people who reacted with this reaction's emoji.discord4j.discordjson.json.ReactionDatagetData()Gets the data of the reaction.ReactionEmojigetEmoji()Gets this reaction's emoji.booleanselfReacted()Gets whether the current bot user reacted using this reaction's emoji.StringtoString()
-
-
-
Constructor Detail
-
Reaction
public Reaction(GatewayDiscordClient gateway, discord4j.discordjson.json.ReactionData data)
Constructs aReactionwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
getData
public discord4j.discordjson.json.ReactionData getData()
Gets the data of the reaction.- Returns:
- The data of the reaction.
-
getCount
public int getCount()
Gets the number of people who reacted with this reaction's emoji.- Returns:
- The number of people who reacted with this reaction's emoji.
-
selfReacted
public boolean selfReacted()
Gets whether the current bot user reacted using this reaction's emoji.- Returns:
- Whether the current bot user reacted using this reaction's emoji.
-
getEmoji
public ReactionEmoji getEmoji()
Gets this reaction's emoji.- Returns:
- This reaction's emoji.
-
-