bot: Bot setup and teardown done: Connect w/retry, join/leave, full config, and logging.
This commit is contained in:
@@ -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...")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user