summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/thoj/go-ircevent/examples/simple/simple.go
blob: f2c27c60483f1ca0f9f7e9632bcf60bacfaa3b77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()
}