Skip to content

Commit 999afba

Browse files
committed
Support SASL
1 parent e346297 commit 999afba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"net/http"
66
"os"
77
"os/signal"
8-
"syscall"
98
"strings"
9+
"syscall"
1010

1111
"github.com/thoj/go-ircevent"
1212
"gopkg.in/go-playground/webhooks.v5/github"
@@ -25,6 +25,14 @@ func main() {
2525
return
2626
}
2727

28+
// IRC auth config
29+
if _, use := os.LookupEnv("IRC_SASL"); use {
30+
conn.UseSASL = true
31+
conn.SASLLogin = os.Getenv("IRC_USER")
32+
conn.SASLPassword = os.Getenv("IRC_PASS")
33+
conn.SASLMech = "PLAIN"
34+
}
35+
2836
// IRC startup
2937
conn.QuitMessage = "I've probably crashed..."
3038
conn.UseTLS = true
@@ -90,5 +98,6 @@ func main() {
9098
// Shut down
9199
<-done
92100
log.Println("exiting")
101+
conn.Privmsg(channel, "I'm going away now")
93102
conn.Quit()
94103
}

0 commit comments

Comments
 (0)