diff --git a/go.mod b/go.mod index 2a71b7c..89fc78d 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.13 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/gissleh/irc v0.0.0-20200720173331-512ba5aa6fca + github.com/gissleh/irc v0.0.0-20200720191144-af5dc31ff33d ) diff --git a/go.sum b/go.sum index 86ef99c..5dc3046 100644 --- a/go.sum +++ b/go.sum @@ -2,3 +2,5 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/gissleh/irc v0.0.0-20200720173331-512ba5aa6fca h1:vTL3kM7PkVnTy77i2/ewaC0VDmSEF7sAOMDTNIs6rKY= github.com/gissleh/irc v0.0.0-20200720173331-512ba5aa6fca/go.mod h1:h2/fPlbnb11gFpitk0HGxYLgK+bCKGh55QSYNo36X8M= +github.com/gissleh/irc v0.0.0-20200720191144-af5dc31ff33d h1:PbjXoijU290Y6qTD/LM9yyFTWgX8iJtPMQ4Adwsn954= +github.com/gissleh/irc v0.0.0-20200720191144-af5dc31ff33d/go.mod h1:h2/fPlbnb11gFpitk0HGxYLgK+bCKGh55QSYNo36X8M= diff --git a/internal/bot/handler.go b/internal/bot/handler.go index 31607c5..d003c82 100644 --- a/internal/bot/handler.go +++ b/internal/bot/handler.go @@ -31,7 +31,17 @@ func handler(event *irc.Event, client *irc.Client) { bot.stopLoop() conf := config.Get().Server - go bot.Connect(conf.Address, conf.SSL, 0) + go bot.Connect(conf.Address, conf.SSL, 100) + } + + // Log Connections + case "client.connecting": + { + log.Println("Client is connecting...") + } + case "client.connect": + { + log.Println("Client connected!") } // Log joins and leaves @@ -133,6 +143,10 @@ func handler(event *irc.Event, client *irc.Client) { } } + if event.Kind() == "error" { + log.Printf("Client Error (%s) %s\n", event.Verb(), event.Text) + } + // Always log error numerics. if len(event.Verb()) == 3 && event.Verb()[0] == '4' || event.Verb()[0] == '9' { log.Printf("(%s) %s %s\n", event.Verb(), strings.Join(event.Args, " "), event.Text)