Browse Source

Better logging and error reporting.

master
MagicBot 2 years ago
parent
commit
ee676a08ea
  1. 13
      src/discord/handlers/DevRequestHandler.java

13
src/discord/handlers/DevRequestHandler.java

@ -56,17 +56,20 @@ public class DevRequestHandler {
break; break;
} }
if (commandString.isEmpty() == false) { if (commandString.isEmpty()) {
MagicBot.sendResponse(event, "Unrecognized Dev command: " + serverCommand + " " + commandArgument);
return;
}
processBuilder = new ProcessBuilder("/bin/sh", "-c", commandString + " " + commandArgument);
processBuilder = new ProcessBuilder("/bin/sh", "-c", commandString + " " + commandArgument); try {
try {
processBuilder.start(); processBuilder.start();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Logger.info(e.toString());
} }
MagicBot.sendResponse(event, "Executed on dev: " + serverCommand + " " + commandArgument); MagicBot.sendResponse(event, "Executed on dev: " + serverCommand + " " + commandArgument);
Logger.info(event.getAuthor().getName() + " told dev to " + serverCommand + " " + commandArgument); Logger.info(event.getAuthor().getName() + " told dev to " + serverCommand + " " + commandArgument);
} }
}
} }
Loading…
Cancel
Save