go-ircevent/example/test.go

20 lines
366 B
Go
Raw Normal View History

2009-11-18 00:28:12 +00:00
package main
import (
2010-08-06 21:25:03 +00:00
irc "github.com/thoj/Go-IRC-Client-Library"
"fmt"
"os"
2009-11-18 00:28:12 +00:00
)
func main() {
irccon := irc.IRC("testgo", "testgo")
err := irccon.Connect("irc.efnet.net:6667")
2009-11-18 00:28:12 +00:00
if err != nil {
fmt.Printf("%s\n", err)
fmt.Printf("%#v\n", irccon)
os.Exit(1)
2009-11-18 00:28:12 +00:00
}
irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo") })
irccon.Loop();
2009-11-18 00:28:12 +00:00
}