diff options
author | alex | 2018-10-21 12:57:23 +0100 |
---|---|---|
committer | alex | 2018-10-21 13:04:35 +0100 |
commit | 61b84d9fd997d61f4e5bb6adc63a2310036a242e (patch) | |
tree | e15d066c7ac3ea61785018b37da8dcaae26c03e5 /main.go | |
parent | 55bc749f896c25adb57125fd168a1e3ccfc0cd48 (diff) | |
download | watbot-61b84d9fd997d61f4e5bb6adc63a2310036a242e.tar.gz watbot-61b84d9fd997d61f4e5bb6adc63a2310036a242e.tar.bz2 watbot-61b84d9fd997d61f4e5bb6adc63a2310036a242e.zip |
Reimplemented python bot in golang, skipped a few features
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -2,21 +2,28 @@ package main import "fmt" import "github.com/go-irc/irc" -import flag"github.com/namsral/flag" +import "github.com/namsral/flag" +import "crypto/tls" -func testHandler(c *irc.Client, m *irc.Message) { - fmt.Println("Client: %+v", c) -} +import "git.circuitco.de/self/watbot/wat" func main() { pass := flag.String("pass", "", "password") flag.Parse() config := irc.ClientConfig { - Nick: "wat", + Nick: "watt", Pass: *pass, - User: "wat", + User: "wat/tripsit", Name: "wat", - Handler: irc.HandlerFunc(testHandler), } - fmt.Printf("Hello world %+v\n", config) + 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 + } + wwat := wat.NewWatBot(&config, conn) + wwat.Run() } |