|
|
|
@ -2,11 +2,13 @@ package net.pingex.dcf.commands;
|
|
|
|
|
|
|
|
|
|
import net.pingex.dcf.core.Configuration;
|
|
|
|
|
import net.pingex.dcf.permissions.DefaultPermission;
|
|
|
|
|
import net.pingex.dcf.permissions.PermissionsHandler;
|
|
|
|
|
import net.pingex.dcf.util.ArgumentParser;
|
|
|
|
|
import net.pingex.dcf.util.DiscordInteractionsUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import sx.blah.discord.handle.impl.events.MessageReceivedEvent;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Internal commands of DCF.
|
|
|
|
@ -47,7 +49,9 @@ public class InternalCommands implements IWithCommands
|
|
|
|
|
public void execute(MessageReceivedEvent event, List<String> arguments)
|
|
|
|
|
{
|
|
|
|
|
// Parameters
|
|
|
|
|
Set<Command> bank = CommandRegistry.getRegistry();
|
|
|
|
|
Set<Command> bank = CommandRegistry.getRegistry()
|
|
|
|
|
.stream().filter(command -> PermissionsHandler.canRunCommand(event.getMessage(), command)).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
|
|
int amountPages = (int) Math.ceil(bank.size()/(double)COMMANDS_PER_PAGE);
|
|
|
|
|
int requestedPage;
|
|
|
|
|
int longestCommand = bank.stream().max((o1, o2) -> Integer.compare(o1.getName().length(), o2.getName().length())).get().getName().length();
|
|
|
|
|