|
|
|
@ -77,10 +77,11 @@ class InternalCommandsModule extends AbstractModule
|
|
|
|
|
|
|
|
|
|
int pagesCount = (int) Math.ceil(commands.size()/10.0);
|
|
|
|
|
if(page > pagesCount || page <= 0)
|
|
|
|
|
return "Page doesn't exist. " + pagesCount + " pages are available.";
|
|
|
|
|
return "Page #" + page + " doesn't exist. " + pagesCount + " pages are available.";
|
|
|
|
|
|
|
|
|
|
StringBuffer toReturn = new StringBuffer("List of commands ");
|
|
|
|
|
toReturn.append("(page ").append(page).append("/").append(pagesCount).append(")\n");
|
|
|
|
|
toReturn.append("(page ").append(page).append("/").append(pagesCount).append(") ");
|
|
|
|
|
toReturn.append("- Call `/help command` for individual help and usage.\n");
|
|
|
|
|
|
|
|
|
|
int pos = 1;
|
|
|
|
|
for(Map.Entry<String, InvokableMethod> i : commands.entrySet())
|
|
|
|
@ -88,10 +89,7 @@ class InternalCommandsModule extends AbstractModule
|
|
|
|
|
if(pos > page*10-10 && pos <= page*10)
|
|
|
|
|
{
|
|
|
|
|
toReturn.append("- ").append(i.getKey());
|
|
|
|
|
for(Class<?> j : i.getValue().getMethod().getParameterTypes())
|
|
|
|
|
if(j != MessageReceivedEvent.class)
|
|
|
|
|
toReturn.append(" <").append(j.getName()).append(">");
|
|
|
|
|
toReturn.append("\t\t").append(i.getValue().getMethod().getAnnotation(Command.class).description());
|
|
|
|
|
toReturn.append("\t").append(i.getValue().getMethod().getAnnotation(Command.class).description());
|
|
|
|
|
|
|
|
|
|
// Shorthand
|
|
|
|
|
if(shorthands.containsValue(i.getKey()))
|
|
|
|
|