2018-10-20 01:40:15 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
2018-10-25 02:04:35 +02:00
|
|
|
import "crypto/tls"
|
|
|
|
|
2018-10-20 01:40:15 +02:00
|
|
|
import "github.com/go-irc/irc"
|
2018-10-21 13:57:23 +02:00
|
|
|
import "github.com/namsral/flag"
|
2018-10-20 01:58:30 +02:00
|
|
|
|
2018-10-21 13:57:23 +02:00
|
|
|
import "git.circuitco.de/self/watbot/wat"
|
2018-10-20 01:40:15 +02:00
|
|
|
|
|
|
|
func main() {
|
2018-10-20 01:58:30 +02:00
|
|
|
pass := flag.String("pass", "", "password")
|
|
|
|
flag.Parse()
|
2018-10-25 02:04:35 +02:00
|
|
|
fmt.Printf("PASS len %d\n", len(*pass))
|
2019-01-04 10:55:40 +01:00
|
|
|
config := irc.ClientConfig{
|
2018-10-21 13:57:23 +02:00
|
|
|
Nick: "watt",
|
2018-10-20 01:58:30 +02:00
|
|
|
Pass: *pass,
|
2018-10-21 13:57:23 +02:00
|
|
|
User: "wat/tripsit",
|
2018-10-20 01:40:15 +02:00
|
|
|
Name: "wat",
|
|
|
|
}
|
2019-01-04 10:55:40 +01:00
|
|
|
watConfig := wat.WatConfig{
|
|
|
|
PermittedChannels: []string{
|
|
|
|
"##wat",
|
|
|
|
//"##test",
|
|
|
|
"##sweden",
|
|
|
|
"##freedom",
|
|
|
|
},
|
|
|
|
IgnoredHosts: []string{
|
|
|
|
"tripsit/user/creatonez",
|
|
|
|
},
|
|
|
|
}
|
2018-10-21 13:57:23 +02:00
|
|
|
tcpConf := &tls.Config{
|
|
|
|
InsecureSkipVerify: true,
|
|
|
|
}
|
|
|
|
conn, err := tls.Dial("tcp", "127.0.0.1:9696", tcpConf)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("err " + err.Error())
|
|
|
|
return
|
|
|
|
}
|
2019-01-04 10:55:40 +01:00
|
|
|
wwat := wat.NewWatBot(&config, &watConfig, conn)
|
2018-10-21 13:57:23 +02:00
|
|
|
wwat.Run()
|
2018-10-20 01:40:15 +02:00
|
|
|
}
|