5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-11 15:45:49 +00:00
matterbridge/vendor/github.com/thoj/go-ircevent/examples/simple/simple.go

28 lines
682 B
Go
Raw Normal View History

2017-02-18 22:00:46 +00:00
package main
import (
"github.com/thoj/go-ircevent"
"crypto/tls"
"fmt"
)
const channel = "#go-eventirc-test";
const serverssl = "irc.freenode.net:7000"
func main() {
ircnick1 := "blatiblat"
irccon := irc.IRC(ircnick1, "IRCTestSSL")
irccon.VerboseCallbackHandler = true
irccon.Debug = true
irccon.UseTLS = true
irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join(channel) })
irccon.AddCallback("366", func(e *irc.Event) { })
err := irccon.Connect(serverssl)
if err != nil {
fmt.Printf("Err %s", err )
return
}
irccon.Loop()
}