summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/thoj/go-ircevent/examples/simple
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/thoj/go-ircevent/examples/simple')
-rw-r--r--vendor/github.com/thoj/go-ircevent/examples/simple/simple.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/github.com/thoj/go-ircevent/examples/simple/simple.go b/vendor/github.com/thoj/go-ircevent/examples/simple/simple.go
new file mode 100644
index 00000000..f2c27c60
--- /dev/null
+++ b/vendor/github.com/thoj/go-ircevent/examples/simple/simple.go
@@ -0,0 +1,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()
+}