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 java.util.concurrent.CompletableFuture<java.util.List<User>>getUsers()Gets a list with all users who used this reaction.static java.util.concurrent.CompletableFuture<java.util.List<User>>getUsers(DiscordApi api, long channelId, long messageId, Emoji emoji)Gets a list with all users who used this reaction.static java.util.concurrent.CompletableFuture<java.util.List<User>>getUsers(DiscordApi api, java.lang.String channelId, java.lang.String messageId, Emoji emoji)Gets a list with all users who used this reaction.default java.util.concurrent.CompletableFuture<java.lang.Void>remove()Removes all reactors.static java.util.concurrent.CompletableFuture<java.lang.Void>removeUser(DiscordApi api, long channelId, long messageId, Emoji emoji, long userId)Removes a user from the list of reactors.static java.util.concurrent.CompletableFuture<java.lang.Void>removeUser(DiscordApi api, java.lang.String channelId, java.lang.String messageId, Emoji emoji, java.lang.String userId)Removes a user from the list of reactors.default java.util.concurrent.CompletableFuture<java.lang.Void>removeUser(User user)Removes a user from the list of reactors.default java.util.concurrent.CompletableFuture<java.lang.Void>removeYourself()Removes the user of the connected account from the list of reactors.
-
-
-
Method Detail
-
getUsers
static java.util.concurrent.CompletableFuture<java.util.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 java.util.concurrent.CompletableFuture<java.util.List<User>> getUsers(DiscordApi api, java.lang.String channelId, java.lang.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 java.util.concurrent.CompletableFuture<java.util.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 java.util.concurrent.CompletableFuture<java.lang.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 java.util.concurrent.CompletableFuture<java.lang.Void> removeUser(DiscordApi api, java.lang.String channelId, java.lang.String messageId, Emoji emoji, java.lang.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 java.util.concurrent.CompletableFuture<java.lang.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 java.util.concurrent.CompletableFuture<java.lang.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 java.util.concurrent.CompletableFuture<java.lang.Void> remove()
Removes all reactors.- Returns:
- A future to tell us if the action was successful.
-
-