public class MessageReaction
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MessageReaction.ReactionEmote
Represents an Emoji/Emote of a MessageReaction
This is used to wrap both emojis and emotes |
Constructor and Description |
---|
MessageReaction(MessageChannel channel,
MessageReaction.ReactionEmote emote,
java.lang.String messageId,
boolean self,
int count)
Creates a new MessageReaction instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
MessageChannel |
getChannel()
The
MessageChannel
this Reaction was used in. |
int |
getCount()
The amount of users that already reacted with this Reaction
This is not updated, it is a final int per Reaction instance |
MessageReaction.ReactionEmote |
getEmote()
The
ReactionEmote
of this Reaction |
JDA |
getJDA()
The JDA instance of this Reaction
|
java.lang.String |
getMessageId()
The message id this reaction is attached to
|
ReactionPaginationAction |
getUsers()
Retrieves the
Users that
already reacted with this MessageReaction. |
ReactionPaginationAction |
getUsers(int amount)
Retrieves the
Users that
already reacted with this MessageReaction. |
boolean |
isSelf()
Whether the currently logged in account has reacted with this reaction
|
RestAction<java.lang.Void> |
removeReaction()
Removes this Reaction from the Message.
|
RestAction<java.lang.Void> |
removeReaction(User user)
Removes this Reaction from the Message.
|
java.lang.String |
toString() |
public MessageReaction(MessageChannel channel, MessageReaction.ReactionEmote emote, java.lang.String messageId, boolean self, int count)
channel
- The MessageChannel
this Reaction was used inemote
- The ReactionEmote
that was usedmessageId
- The message id this reaction is attached toself
- Whether we already reacted with this Reactioncount
- The amount of people that reacted with this Reactionpublic JDA getJDA()
public boolean isSelf()
public int getCount()
final int
per Reaction instancepublic MessageChannel getChannel()
MessageChannel
this Reaction was used in.public MessageReaction.ReactionEmote getEmote()
ReactionEmote
of this Reactionpublic java.lang.String getMessageId()
public ReactionPaginationAction getUsers()
Users
that
already reacted with this MessageReaction.
getUsers(int)
with 100
.
Possible ErrorResponses include:
UNKNOWN_MESSAGE
UNKNOWN_CHANNEL
MISSING_ACCESS
ReactionPaginationAction
public ReactionPaginationAction getUsers(int amount)
Users
that
already reacted with this MessageReaction. The maximum amount of users
that can be retrieved is 100.
Possible ErrorResponses include:
UNKNOWN_MESSAGE
UNKNOWN_CHANNEL
MISSING_ACCESS
amount
- the amount of users to retrieveReactionPaginationAction
java.lang.IllegalArgumentException
- if the provided amount is not between 1-100public RestAction<java.lang.Void> removeReaction()
removeReaction(User)
.
Possible ErrorResponses include:
UNKNOWN_MESSAGE
UNKNOWN_CHANNEL
MISSING_ACCESS
RestAction
- Type: Void
Nothing is returned on successpublic RestAction<java.lang.Void> removeReaction(User user)
User
provided.
If the provided User did not react with this Reaction this does nothing.
Possible ErrorResponses include:
UNKNOWN_MESSAGE
UNKNOWN_CHANNEL
MISSING_ACCESS
user
- The User of which to remove the reactionRestAction
- Type: Void
Nothing is returned on successjava.lang.IllegalArgumentException
- If the provided user
is null.PermissionException
- if the provided User is not us and we do not have permission to
manage messages
in the channel this reaction was used inpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object