示例#1
0
 private void commandMessage(
     String sender, String message, SantraConnector.MessageSession session) {
   if (!admins.contains(sender)) {
     session.sendMessage(
         String.format("@%s %s", sender, NOSY_RESPONSES[random.nextInt(NOSY_RESPONSES.length)]));
     return;
   }
   if (message.startsWith("reload")) {
     String botName = message.substring("reload".length()).trim();
     if ("".equals(botName)) {
       botName = arguments.getBotName();
     }
     try {
       reload(botName);
       session.sendMessage("Reload complete.");
     } catch (IOException | GitAPIException ex) {
       session.sendMessage(String.format("Reload failed: %s.", ex.getMessage()));
     }
   }
 }
示例#2
0
 private void initBot() {
   initBot(arguments.getBotName());
 }