Пример #1
0
  private Mining(String url, String path) {
    this.url = url;
    url = url.substring(url.indexOf('@') + 1);
    if (!new File(path).isDirectory()) {
      try {
        ForgeModule.clone(url, path);
      } catch (IOException | GitAPIException e) {
        e.printStackTrace();
      }
    }

    this.git = new VCSModule(path);
  }
Пример #2
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()));
     }
   }
 }