Interface ReactionPaginationAction

  • All Superinterfaces:
    Iterable<User>, PaginationAction<User,​ReactionPaginationAction>, RestAction<List<User>>

    public interface ReactionPaginationAction
    extends PaginationAction<User,​ReactionPaginationAction>
    PaginationAction that paginates the reaction users endpoint.
    Note that this implementation is not considered thread-safe as modifications to the cache are not done with a lock. Calling methods on this class from multiple threads is not recommended.

    Must provide not-null MessageReaction to compile a valid pagination route.

    Limits:

    Minimum - 1
    Maximum - 100

    Example

    
     ReactionPaginationAction users = reaction.retrieveUsers();
    
     Optional<User> optUser = users.stream().skip(ThreadLocalRandom.current().nextInt(reaction.getCount())).findFirst();
     optUser.ifPresent( (user) -> user.openPrivateChannel().queue(
             (channel) -> channel.sendMessage("I see you reacted to my message :eyes:").queue()
     ));
     
    Since:
    3.1
    See Also:
    MessageReaction.retrieveUsers()