mirror of https://github.com/fluffle/goirc
Update example client with changes.
This commit is contained in:
parent
961e38d7bf
commit
419dba1e75
|
@ -11,11 +11,12 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
// create new IRC connection
|
// create new IRC connection
|
||||||
c := irc.New("GoTest", "gotest", "GoBot")
|
c := irc.New("GoTest", "gotest", "GoBot")
|
||||||
|
c.Debug = true
|
||||||
c.AddHandler("connected",
|
c.AddHandler("connected",
|
||||||
func(conn *irc.Conn, line *irc.Line) { conn.Join("#go-nuts") })
|
func(conn *irc.Conn, line *irc.Line) { conn.Join("#go-nuts") })
|
||||||
|
|
||||||
// connect to server
|
// 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)
|
fmt.Printf("Connection error: %s\n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -82,7 +83,7 @@ func main() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
fmt.Println("Reconnecting...")
|
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)
|
fmt.Printf("Connection error: %s\n", err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue