Interface Reaction



  • public interface Reaction
    This class represents a reaction.
    • 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,
                                                  User user)
        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.
        user - 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,
                                                  User user)
        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.
        user - 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.