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 - 100Example
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()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.requests.restaction.pagination.PaginationAction
PaginationAction.PaginationIterator<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageReaction
getReaction()
The current targetMessageReaction
-
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.pagination.PaginationAction
cache, cacheSize, forEachAsync, forEachAsync, forEachRemaining, forEachRemainingAsync, forEachRemainingAsync, getCached, getFirst, getLast, getLastKey, getLimit, getMaxLimit, getMinLimit, isCacheEnabled, isEmpty, iterator, limit, parallelStream, setCheck, skipTo, spliterator, stream, takeAsync, takeRemainingAsync, takeUntilAsync, takeUntilAsync, takeWhileAsync, takeWhileAsync
-
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
-
-
-
-
Method Detail
-
getReaction
@Nonnull MessageReaction getReaction()
The current targetMessageReaction
- Returns:
- The current MessageReaction
-
-