summaryrefslogtreecommitdiffstats
path: root/main.go
blob: 8a6f2e55a817b1f8efceb5dbea6468899614526d (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
package main

import "fmt"
import "crypto/tls"

import "github.com/go-irc/irc"
import "github.com/namsral/flag"

import "git.circuitco.de/self/watbot/wat"

func main() {
	pass := flag.String("pass", "", "password")
	flag.Parse()
	fmt.Printf("PASS len %d\n", len(*pass))
	config := irc.ClientConfig{
		Nick: "watbot",
		Pass: *pass,
		User: "watbot",
		Name: "watbot",
	}
	watConfig := wat.WatConfig{
		PermittedChannels: []string{
			"#lucy",
			"#sweden",
		},
		IgnoredHosts: []string{
			"tripsit/user/creatonez",
		},
	}
	tcpConf := &tls.Config{
		InsecureSkipVerify: false,
	}
	conn, err := tls.Dial("tcp", "irc.casa:6697", tcpConf)
	if err != nil {
		fmt.Println("err " + err.Error())
		return
	}
	wwat := wat.NewWatBot(&config, &watConfig, conn)
	wwat.Run()
}