mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-15 07:35:02 +01:00
lots of optimizations
This commit is contained in:
parent
d79e80d422
commit
9684b72cc2
14 changed files with 206 additions and 83 deletions
|
|
@ -3,7 +3,6 @@ package com.github.nilstrieb.cofig;
|
|||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.Event;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
|
|
@ -15,13 +14,12 @@ public class Config {
|
|||
public static final long THIS_ID = 801015254023798825L;
|
||||
|
||||
public static EmbedBuilder getDefaultEmbed() {
|
||||
|
||||
EmbedBuilder builder = new EmbedBuilder();
|
||||
builder.setColor(Config.DEFAULT_COLOR);
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static EmbedBuilder getDefaultEmbed(MessageReceivedEvent event) {
|
||||
public static EmbedBuilder getDefaultEmbed(Event event) {
|
||||
User killua = event.getJDA().getUserById(Config.THIS_ID);
|
||||
Objects.requireNonNull(killua, "user killua not found");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,13 @@ package com.github.nilstrieb.commands.fun;
|
|||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.commands.handler.Command;
|
||||
import com.github.nilstrieb.reactions.ReactionEventManager;
|
||||
import com.github.nilstrieb.reactions.ReactionListener;
|
||||
import com.github.nilstrieb.util.DepartureSong;
|
||||
import com.github.nilstrieb.util.MultiPageEmbed;
|
||||
import com.iwebpp.crypto.TweetNaclFast;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class DepartureCommand extends Command {
|
||||
public DepartureCommand() {
|
||||
super("departure");
|
||||
super("departure", "Returns the lyrics of the Hunter x Hunter Opening Song, Departure");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -44,8 +35,6 @@ public class DepartureCommand extends Command {
|
|||
japaneseBuilder.addField("", DepartureSong.LYRICS_JAPANESE[i], false);
|
||||
}
|
||||
|
||||
event.getTextChannel().sendMessage(latinBuilder.build()).queue((message -> {
|
||||
new MultiPageEmbed(message, latinBuilder, japaneseBuilder);
|
||||
}));
|
||||
reply(event, latinBuilder.build(), japaneseBuilder.build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,22 @@
|
|||
package com.github.nilstrieb.commands.fun;
|
||||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.commands.handler.Command;
|
||||
import com.github.nilstrieb.util.KilluaQuotes;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
public class QuoteCommand extends Command {
|
||||
public QuoteCommand() {
|
||||
super("quote");
|
||||
super("quote", "Get a quote from Killua");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
replyEmbed(event, "Killuas Quotes", KilluaQuotes.getRandomQuote());
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event)
|
||||
.addField("Killuas Quotes", KilluaQuotes.getRandomQuote(), false);
|
||||
|
||||
reply(event, builder.build());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
|||
|
||||
public class SayCommand extends Command {
|
||||
public SayCommand(){
|
||||
super("say");
|
||||
super("say", "Let Killua say something", "say hello gon", "<message>");
|
||||
}
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
|
|
|
|||
|
|
@ -1,43 +1,55 @@
|
|||
package com.github.nilstrieb.commands.handler;
|
||||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import com.github.nilstrieb.util.MultiPageEmbed;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.Event;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public abstract class Command {
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final String exampleUsage;
|
||||
private final String arguments;
|
||||
private final CommandParser parser = CommandParser.getInstance();
|
||||
|
||||
public Command(String name) {
|
||||
public Command(String name, String description, String exampleUsage, String arguments, boolean hidden) {
|
||||
this.name = name;
|
||||
CommandHandler.addCommand(name, this);
|
||||
this.description = description;
|
||||
this.exampleUsage = exampleUsage;
|
||||
this.arguments = arguments;
|
||||
CommandHandler.addCommand(name, this, hidden);
|
||||
}
|
||||
|
||||
public Command(String name, String description, String exampleUsage, String arguments){
|
||||
this(name, description, exampleUsage, arguments, false);
|
||||
}
|
||||
|
||||
public Command(String name, String description){
|
||||
this(name, description, name, "", false);
|
||||
}
|
||||
|
||||
public abstract void called(MessageReceivedEvent event, String args);
|
||||
|
||||
protected void reply(MessageReceivedEvent event, String message) {
|
||||
event.getTextChannel().sendMessage(message).queue();
|
||||
if(!message.equals("")){
|
||||
event.getTextChannel().sendMessage(message).queue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void reply(MessageReceivedEvent event, MessageEmbed embed) {
|
||||
event.getTextChannel().sendMessage(embed).queue();
|
||||
if(!embed.isEmpty()){
|
||||
event.getTextChannel().sendMessage(embed).queue();
|
||||
}
|
||||
}
|
||||
|
||||
protected void replyEmbed(MessageReceivedEvent event, String fieldTitle, String fieldContent) {
|
||||
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event);
|
||||
builder.addField(fieldTitle, fieldContent, false);
|
||||
|
||||
event.getTextChannel().sendMessage(builder.build()).queue();
|
||||
|
||||
protected void reply(MessageReceivedEvent event, MessageEmbed ... embeds){
|
||||
if(!embeds[0].isEmpty()){
|
||||
event.getTextChannel().sendMessage(embeds[0]).queue(message -> new MultiPageEmbed(message, embeds));
|
||||
}
|
||||
}
|
||||
|
||||
protected void deleteMsg(MessageReceivedEvent event, long delay) {
|
||||
|
|
@ -54,4 +66,21 @@ public abstract class Command {
|
|||
protected void deleteMsg(MessageReceivedEvent event) {
|
||||
event.getMessage().delete().queue();
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getExampleUsage() {
|
||||
return Config.PREFIX + exampleUsage;
|
||||
}
|
||||
|
||||
public String getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +1,104 @@
|
|||
package com.github.nilstrieb.commands.handler;
|
||||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.Event;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class CommandHandler {
|
||||
private static Map<String, Command> commands = new HashMap<>();
|
||||
|
||||
private static CommandParser parser = CommandParser.getInstance();
|
||||
public static final int MAX_PAGE_LENGTH = 10;
|
||||
private static final Map<String, Command> commands = new HashMap<>();
|
||||
private static final Map<String, Command> hiddenCommands = new HashMap<>();
|
||||
private static final CommandParser parser = CommandParser.getInstance();
|
||||
|
||||
public static void addCommand(String key, Command cmd, boolean hidden) {
|
||||
if (hidden) {
|
||||
hiddenCommands.put(key, cmd);
|
||||
} else {
|
||||
commands.put(key, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addCommand(String key, Command cmd) {
|
||||
commands.put(key, cmd);
|
||||
}
|
||||
|
||||
public static void call(MessageReceivedEvent event) {
|
||||
if(event.getMessage().getContentRaw().startsWith(Config.PREFIX)) {
|
||||
System.out.println("[CHandler] contains prefix");
|
||||
if (event.getMessage().getContentRaw().toLowerCase().startsWith(Config.PREFIX)) {
|
||||
String[] split = parser.splitOffCommandName(event.getMessage().getContentRaw());
|
||||
System.out.println("[CHandler] cmd: '" + split[0] + "'" + " args: '" + split[1] + "'");
|
||||
if(commands.containsKey(split[0])) {
|
||||
System.out.println("[CHandler] command exists: " + split[0]);
|
||||
commands.get(split[0]).called(event, split[1]);
|
||||
String command = split[0];
|
||||
System.out.println("[CHandler] cmd: '" + command + "'" + " args: '" + split[1] + "'");
|
||||
if (commands.containsKey(command)) {
|
||||
System.out.println("[CHandler] command exists: " + command);
|
||||
commands.get(command).called(event, split[1]);
|
||||
} else if (hiddenCommands.containsKey(command)) {
|
||||
System.out.println("[CHandler] hidden command exists: " + command);
|
||||
hiddenCommands.get(command).called(event, split[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int commandAmount() {
|
||||
return commands.size();
|
||||
}
|
||||
|
||||
public static EmbedBuilder getHelpList(Event event) {
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event);
|
||||
builder.setTitle("Killua help");
|
||||
for (Command s : commands.values()) {
|
||||
builder.addField(s.getName(), s.getDescription(), false);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static MessageEmbed[] getHelpLists(Event event) {
|
||||
|
||||
int length = commands.size();
|
||||
int pages = length / MAX_PAGE_LENGTH + 1;
|
||||
EmbedBuilder[] builders = new EmbedBuilder[pages];
|
||||
|
||||
|
||||
int i = 0, j = 0;
|
||||
EmbedBuilder builder = null;
|
||||
for (Command value : commands.values()) {
|
||||
if (i % MAX_PAGE_LENGTH == 0) {
|
||||
builder = Config.getDefaultEmbed(event);
|
||||
builder.setTitle("Killua help");
|
||||
builders[j] = builder;
|
||||
j++;
|
||||
}
|
||||
builder.addField(value.getName(), value.getDescription(), false);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
System.out.println(Arrays.toString(builders));
|
||||
MessageEmbed[] messageEmbeds = new MessageEmbed[pages];
|
||||
for (i = 0; i < builders.length; i++) {
|
||||
messageEmbeds[i] = builders[i].build();
|
||||
}
|
||||
return messageEmbeds;
|
||||
}
|
||||
|
||||
public static MessageEmbed getCommandHelp(Event event, String command) {
|
||||
Command cmd = commands.get(command);
|
||||
if (cmd != null) {
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event)
|
||||
.setTitle("Killua help: " + cmd.getName())
|
||||
.addField("Name", cmd.getName(), true)
|
||||
.addField("Description", cmd.getDescription(), true)
|
||||
.addField("Example usage", "`" + cmd.getExampleUsage() + "`", true);
|
||||
|
||||
if (!cmd.getArguments().equals("")) {
|
||||
builder.addField("Arguments", "`" + cmd.getArguments() + "`", true);
|
||||
}
|
||||
return builder.build();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,15 @@ import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
|||
|
||||
public class EvalCommand extends Command {
|
||||
public EvalCommand() {
|
||||
super("eval");
|
||||
super("eval", "no", "", "<command>", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
if(args.startsWith("event.getJDA().getToken()")){
|
||||
reply(event, "ODAxDKE1MjU0UDOzNzk4ODI1.YAaYOg.u.MEQ_2bzQkVVZ5y1J5Q23Se5CU");
|
||||
} else {
|
||||
reply(event, "No arguments provided.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,33 @@
|
|||
package com.github.nilstrieb.commands.info;
|
||||
|
||||
import com.github.nilstrieb.commands.handler.Command;
|
||||
import com.github.nilstrieb.commands.handler.CommandHandler;
|
||||
import com.github.nilstrieb.util.MultiPageEmbed;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HelpCommand extends Command {
|
||||
public HelpCommand() {
|
||||
super("help");
|
||||
super("help", "Shows this message", "help invite", "(command name)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
reply(event, "hallo");
|
||||
if(args.length() == 0) {
|
||||
if (CommandHandler.commandAmount() > CommandHandler.MAX_PAGE_LENGTH) {
|
||||
reply(event, CommandHandler.getHelpLists(event));
|
||||
|
||||
} else {
|
||||
reply(event, CommandHandler.getHelpList(event).build());
|
||||
}
|
||||
} else {
|
||||
MessageEmbed help = CommandHandler.getCommandHelp(event, args.split(" ")[0]);
|
||||
if (help != null) {
|
||||
reply(event, help);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,32 +3,28 @@ package com.github.nilstrieb.commands.info;
|
|||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.commands.handler.Command;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
|
||||
public class InviteCommand extends Command {
|
||||
private static final String INVITE_LINK =
|
||||
"(https://discord.com/api/oauth2/authorize?client_id=801015254023798825&permissions=8&scope=bot)";
|
||||
|
||||
public InviteCommand() {
|
||||
super("invite");
|
||||
super("invite", "Get the invite link for this bot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
|
||||
User nils = event.getJDA().getUserById(Config.NILS_ID);
|
||||
Objects.requireNonNull(nils, "user nils not found");
|
||||
event.getJDA().retrieveUserById(Config.NILS_ID).queue(nils -> {
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event)
|
||||
.setTitle("Invite Killua to your server!")
|
||||
.addField("Invite link", "[Invite]" + INVITE_LINK, true)
|
||||
.setFooter("This bot was made by " + nils.getAsTag(), nils.getAvatarUrl());
|
||||
reply(event, builder.build());
|
||||
});
|
||||
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event);
|
||||
builder.setTitle("Invite Killua to your server!")
|
||||
.addField("Invite Link", "[Invite]" + INVITE_LINK, true)
|
||||
.setFooter("This bot was made by " + nils.getAsTag());
|
||||
|
||||
reply(event, builder.build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,33 @@
|
|||
package com.github.nilstrieb.commands.info;
|
||||
|
||||
import com.github.nilstrieb.cofig.Config;
|
||||
import com.github.nilstrieb.commands.handler.Command;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
|
||||
public class ToukaCommand extends Command {
|
||||
|
||||
private static final String TOUKA_INVITE =
|
||||
"(https://discord.com/channels/799696420386504795/799721568259145750/801075666862211092)";
|
||||
"(https://discord.com/oauth2/authorize?client_id=783720725848129566&permissions=8192&scope=bot)";
|
||||
|
||||
public ToukaCommand() {
|
||||
super("touka");
|
||||
super("touka", "Get the invite link for the Touka bot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void called(MessageReceivedEvent event, String args) {
|
||||
EmbedBuilder builder = new EmbedBuilder();
|
||||
builder.setAuthor("Invite the Touka bot")
|
||||
.setAuthor("The Touka bot was made by angelsflyinhell")
|
||||
.addField("", "[Invite]" + TOUKA_INVITE, false);
|
||||
event.getTextChannel().sendMessage(builder.build()).queue();
|
||||
event.getJDA().retrieveUserById(265849018662387712L).queue(yuki -> {
|
||||
event.getJDA().retrieveUserById(783720725848129566L).queue(touka -> {
|
||||
EmbedBuilder builder = Config.getDefaultEmbed(event)
|
||||
.setTitle("Invite the Touka bot")
|
||||
.setFooter("The Touka bot was made by " + yuki.getAsTag(), yuki.getAvatarUrl())
|
||||
.setThumbnail(touka.getAvatarUrl())
|
||||
.addField("Invite link", "[Invite]" + TOUKA_INVITE, false);
|
||||
event.getTextChannel().sendMessage(builder.build()).queue();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,17 +6,19 @@ import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent;
|
|||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ReactionEventListener extends ListenerAdapter {
|
||||
@Override
|
||||
public void onMessageReactionAdd(@NotNull MessageReactionAddEvent event) {
|
||||
if (!event.getUser().isBot()) {
|
||||
if (!Objects.requireNonNull(event.getUser(), "message author is null").isBot()) {
|
||||
ReactionEventManager.onReactionAdd(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReactionRemove(@NotNull MessageReactionRemoveEvent event) {
|
||||
if (!event.getUser().isBot()) {
|
||||
if (!Objects.requireNonNull(event.getUser(), "message author is null").isBot()) {
|
||||
ReactionEventManager.onReactionRemove(event);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ public class StartUpListener extends ListenerAdapter {
|
|||
|
||||
@Override
|
||||
public void onReady(@NotNull ReadyEvent event) {
|
||||
System.out.println("started");
|
||||
System.out.println("[Startup] Killua started");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import java.util.Random;
|
|||
|
||||
public class KilluaQuotes {
|
||||
|
||||
private static Random random = new Random();
|
||||
private static final Random random = new Random();
|
||||
private static final String[] quotes = {
|
||||
"When I say it doesn't hurt me, that means I can bear it.",
|
||||
"Gon, you are light itself. Sometimes you're too bright and I can't look at you... But can I still stay by your side?",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.github.nilstrieb.util;
|
|||
|
||||
import com.github.nilstrieb.reactions.ReactionEventManager;
|
||||
import com.github.nilstrieb.reactions.ReactionListener;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
|
||||
|
|
@ -20,19 +19,16 @@ public class MultiPageEmbed implements ReactionListener {
|
|||
private final String prevReaction;
|
||||
private final String nextReaction;
|
||||
|
||||
public MultiPageEmbed(Message message, EmbedBuilder... pages) {
|
||||
public MultiPageEmbed(Message message, MessageEmbed... pages) {
|
||||
this(message, PREVIOUS_PAGE_DEFAULT_REACTION, NEXT_PAGE_DEFAULT_REACTION, pages);
|
||||
}
|
||||
|
||||
public MultiPageEmbed(Message message, String prevReaction, String nextReaction, EmbedBuilder... builders) {
|
||||
public MultiPageEmbed(Message message, String prevReaction, String nextReaction, MessageEmbed... pages) {
|
||||
this.message = message;
|
||||
this.prevReaction = prevReaction;
|
||||
this.nextReaction = nextReaction;
|
||||
|
||||
pages = new MessageEmbed[builders.length];
|
||||
for (int i = 0; i < pages.length; i++) {
|
||||
pages[i] = builders[i].build();
|
||||
}
|
||||
this.pages = pages;
|
||||
currentState = 0;
|
||||
|
||||
message.addReaction(prevReaction).queue();
|
||||
|
|
@ -45,14 +41,18 @@ public class MultiPageEmbed implements ReactionListener {
|
|||
public void onReactionAdded(MessageReactionAddEvent event) {
|
||||
String name = event.getReaction().getReactionEmote().getName();
|
||||
if (name.equals(nextReaction)) {
|
||||
if(currentState + 1 < pages.length){
|
||||
if (currentState + 1 < pages.length) {
|
||||
currentState++;
|
||||
message.editMessage(pages[currentState]).queue();
|
||||
if (!pages[currentState].isEmpty()) {
|
||||
message.editMessage(pages[currentState]).queue();
|
||||
}
|
||||
}
|
||||
} else if (name.equals(prevReaction)) {
|
||||
if(currentState > 0){
|
||||
if (currentState > 0) {
|
||||
currentState--;
|
||||
message.editMessage(pages[currentState]).queue();
|
||||
if (!pages[currentState].isEmpty()) {
|
||||
message.editMessage(pages[currentState]).queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
Objects.requireNonNull(event.getUser(), "[MultiPageEmbed] reaction user was null");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue