Ejemplo n.º 1
0
 private void setBotInfo() {
   this.setVerbose(config.getDebug());
   this.setAutoNickChange(config.getAutoNickChange());
   this.setAutoReconnect(config.getAutoReconnect());
   this.setMessageDelay(config.getMessageDelay());
   this.setVersion(
       "FoxBot - A Java IRC bot written by TheReverend403 - https://github.com/TheReverend403/FoxBot");
   this.setAutoSplitMessage(true);
   this.setName(config.getBotNick());
   this.setLogin(config.getBotIdent());
 }
Ejemplo n.º 2
0
  private void connectToServer() {
    try {
      if (config.getServerSsl()) {
        this.connect(
            config.getServerAddress(),
            config.getServerPort(),
            config.getServerPassword(),
            config.getAcceptInvalidSsl()
                ? new UtilSSLSocketFactory().trustAllCertificates().disableDiffieHellman()
                : SSLSocketFactory.getDefault());
      } else {
        this.connect(config.getServerAddress(), config.getServerPort(), config.getServerPassword());
      }

      if (config.useNickserv()) {
        this.identify(config.getNickservPassword());
      }
    } catch (IOException | IrcException ex) {
      Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex);
    }

    for (String channel : config.getChannels()) {
      this.joinChannel(channel);
    }
  }