Package org.javacord.api.entity.message
Interface Reaction
-
public interface ReactionThis class represents a reaction.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontainsYou()Checks if you (the current account) used this reaction.intgetCount()Gets the amount of users who used this reaction.EmojigetEmoji()Gets the emoji of the reaction.MessagegetMessage()Gets the message, the reaction belongs to.default CompletableFuture<List<User>>getUsers()Gets a list with all users who used this reaction.static CompletableFuture<List<User>>getUsers(DiscordApi api, long channelId, long messageId, Emoji emoji)Gets a list with all users who used this reaction.static CompletableFuture<List<User>>getUsers(DiscordApi api, String channelId, String messageId, Emoji emoji)Gets a list with all users who used this reaction.default CompletableFuture<Void>remove()Removes all reactors.static CompletableFuture<Void>removeUser(DiscordApi api, long channelId, long messageId, Emoji emoji, long userId)Removes a user from the list of reactors.static CompletableFuture<Void>removeUser(DiscordApi api, String channelId, String messageId, Emoji emoji, String userId)Removes a user from the list of reactors.default CompletableFuture<Void>removeUser(User user)Removes a user from the list of reactors.default CompletableFuture<Void>removeYourself()Removes the user of the connected account from the list of reactors.
-
-
-
Method Detail
-
getUsers
static CompletableFuture<List<User>> getUsers(DiscordApi api, long channelId, long messageId, Emoji emoji)
Gets a list with all users who used this reaction.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.- Returns:
- A list with all users who used this reaction.
-
getUsers
static CompletableFuture<List<User>> getUsers(DiscordApi api, String channelId, String messageId, Emoji emoji)
Gets a list with all users who used this reaction.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.- Returns:
- A list with all users who used this reaction.
-
getUsers
default CompletableFuture<List<User>> getUsers()
Gets a list with all users who used this reaction.- Returns:
- A list with all users who used this reaction.
-
removeUser
static CompletableFuture<Void> removeUser(DiscordApi api, long channelId, long messageId, Emoji emoji, long userId)
Removes a user from the list of reactors.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.userId- The id of the user to remove.- Returns:
- A future to tell us if the action was successful.
-
removeUser
static CompletableFuture<Void> removeUser(DiscordApi api, String channelId, String messageId, Emoji emoji, String userId)
Removes a user from the list of reactors.- Parameters:
api- The discord api instance.channelId- The id of the message's channel.messageId- The id of the message.emoji- The emoji of the reaction.userId- The id of the user to remove.- Returns:
- A future to tell us if the action was successful.
-
removeUser
default CompletableFuture<Void> removeUser(User user)
Removes a user from the list of reactors.- Parameters:
user- The user to remove.- Returns:
- A future to tell us if the action was successful.
-
getMessage
Message getMessage()
Gets the message, the reaction belongs to.- Returns:
- The message, the reaction belongs to.
-
getEmoji
Emoji getEmoji()
Gets the emoji of the reaction.- Returns:
- The emoji of the reaction.
-
getCount
int getCount()
Gets the amount of users who used this reaction.- Returns:
- The amount of users who used this reaction.
-
containsYou
boolean containsYou()
Checks if you (the current account) used this reaction.- Returns:
- Whether this reaction is used by you or not.
-
removeYourself
default CompletableFuture<Void> removeYourself()
Removes the user of the connected account from the list of reactors.- Returns:
- A future to tell us if the action was successful.
-
remove
default CompletableFuture<Void> remove()
Removes all reactors.- Returns:
- A future to tell us if the action was successful.
-
-