java.lang.Iterable<User>
public class ReactionPaginationAction extends PaginationAction<User,ReactionPaginationAction>
PaginationAction
that paginates the endpoint Route.Messages.GET_REACTION_USERS
.
Must provide not-null MessageReaction
to compile a valid
pagination route.
ReactionPaginationAction users = reaction.getUsers();
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()
));
PaginationAction.PaginationIterator
RestAction.EmptyRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
ReactionPaginationAction(MessageReaction reaction) |
Creates a new PaginationAction instance
|
Modifier and Type | Method | Description |
---|---|---|
MessageReaction |
getReaction() |
The current target
MessageReaction |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cache, cacheSize, forEachAsync, forEachAsync, forEachRemaining, forEachRemainingAsync, forEachRemainingAsync, getCached, getFirst, getLast, getLimit, getMaxLimit, getMinLimit, isCacheEnabled, isEmpty, iterator, limit, parallelStream, setCheck, spliterator, stream, takeAsync, takeRemainingAsync
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public ReactionPaginationAction(MessageReaction reaction)
reaction
- The target MessageReaction
public MessageReaction getReaction()
MessageReaction