Update example client with changes.

This commit is contained in:
Alex Bramley 2010-11-03 23:53:14 +00:00
parent 961e38d7bf
commit 419dba1e75
1 changed files with 3 additions and 2 deletions

View File

@ -11,11 +11,12 @@ import (
func main() {
// create new IRC connection
c := irc.New("GoTest", "gotest", "GoBot")
c.Debug = true
c.AddHandler("connected",
func(conn *irc.Conn, line *irc.Line) { conn.Join("#go-nuts") })
// connect to server
if err := c.Connect("irc.freenode.net", false); err != nil {
if err := c.Connect("irc.freenode.net"); err != nil {
fmt.Printf("Connection error: %s\n", err)
return
}
@ -82,7 +83,7 @@ func main() {
break
}
fmt.Println("Reconnecting...")
if err := c.Connect("irc.freenode.net", false); err != nil {
if err := c.Connect("irc.freenode.net"); err != nil {
fmt.Printf("Connection error: %s\n", err)
break
}