Skip to content

Commit

Permalink
docs cleanup + System.currentTimeMillis
Browse files Browse the repository at this point in the history
  • Loading branch information
Chew committed Feb 12, 2022
1 parent c9cef09 commit 3334186
Showing 1 changed file with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.dv8tion.jda.internal.utils.Checks;
import org.slf4j.LoggerFactory;

import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -82,8 +81,7 @@ protected ButtonEmbedPaginator(EventWaiter waiter, Set<User> users, Set<Role> ro
}

/**
* Begins pagination on page 1 as a new {@link net.dv8tion.jda.api.entities.Message Message}
* in the provided {@link net.dv8tion.jda.api.entities.MessageChannel MessageChannel}.
* Begins pagination on page 1 as a new {@link Message} in the provided {@link MessageChannel}.
*
* @param channel The MessageChannel to send the new Message to
*/
Expand All @@ -93,8 +91,7 @@ public void display(MessageChannel channel) {
}

/**
* Begins pagination on page 1 displaying this by editing the provided
* {@link net.dv8tion.jda.api.entities.Message Message}.
* Begins pagination on page 1 displaying this by editing the provided {@link Message}.
*
* @param message The Message to display the Menu in
*/
Expand All @@ -104,9 +101,8 @@ public void display(Message message) {
}

/**
* Begins pagination as a new {@link net.dv8tion.jda.api.entities.Message Message}
* in the provided {@link net.dv8tion.jda.api.entities.MessageChannel MessageChannel}, starting
* on whatever page number is provided.
* Begins pagination as a new {@link Message} in the provided {@link MessageChannel}, starting on whatever
* page number is provided.
*
* @param channel The MessageChannel to send the new Message to
* @param pageNum The page number to begin on
Expand All @@ -121,11 +117,10 @@ else if (pageNum > embeds.size())
}

/**
* Begins pagination displaying this by editing the provided
* {@link net.dv8tion.jda.api.entities.Message Message}, starting on whatever
* page number is provided.
* Begins pagination displaying this by editing the provided {@link Message}, starting on whatever page number
* is provided.
*
* @param message The MessageChannel to send the new Message to
* @param message The message to edit
* @param pageNum The page number to begin on
*/
public void paginate(Message message, int pageNum) {
Expand All @@ -144,7 +139,7 @@ private void initialize(RestAction<Message> action, int pageNum) {

m.editMessage(renderPage(pageNum)).setActionRow(actions).queue(v -> pagination(m, pageNum));
} else if (waitOnSinglePage) {
String id = Instant.now().toString() + ":STOP";
String id = System.currentTimeMillis() + ":STOP";
m.editMessage(renderPage(pageNum)).setActionRow(Button.of(style, id, STOP)).queue(v -> pagination(m, pageNum));
} else {
finalAction.accept(m);
Expand All @@ -154,7 +149,7 @@ private void initialize(RestAction<Message> action, int pageNum) {

private List<Button> buildButtons() {
// bep = button embed paginator
String id = "bep:" + Instant.now().toString();
String id = "bep:" + System.currentTimeMillis();
List<Button> actions = new ArrayList<>();

actions.add(Button.of(style, id + ":LEFT", LEFT));
Expand Down Expand Up @@ -254,10 +249,7 @@ private Message renderPage(int pageNum) {
}

/**
* The {@link com.jagrosh.jdautilities.menu.Menu.Builder Menu.Builder} for
* a {@link com.jagrosh.jdautilities.menu.EmbedPaginator EmbedPaginator}.
*
* @author Andre_601
* The {@link Menu.Builder} for a {@link ButtonEmbedPaginator}.
*/
public static class Builder extends Menu.Builder<Builder, ButtonEmbedPaginator> {
private BiFunction<Integer, Integer, String> text = (page, pages) -> null;
Expand Down

0 comments on commit 3334186

Please sign in to comment.