bot: Bot setup and teardown done: Connect w/retry, join/leave, full config, and logging.

This commit is contained in:
2018-11-14 21:01:29 +01:00
parent 112c29694d
commit 7336ea2b47
9 changed files with 236 additions and 76 deletions
+4 -3
View File
@@ -25,10 +25,10 @@ func main() {
os.Exit(1)
}
bot := bot.New(context.Background(), conf.Bot.Nicks[0], conf.Bot.Nicks[1:])
err = bot.Connect(conf.Bot.Server, false)
bot := bot.New(context.Background(), conf.Bot.Nicks[0], conf.Bot.Nicks[1:], conf.Bot.User, conf.Bot.RealName)
err = bot.Connect(conf.Server.Address, conf.Server.SSL, 3)
if err != nil {
log.Println("Warning:", err)
log.Println("IRC server cannot be reached:", err)
os.Exit(1)
}
@@ -36,6 +36,7 @@ func main() {
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt)
signal.Notify(interrupt, syscall.SIGTERM)
<-interrupt
log.Println("Interrupt received, stopping...")
}