2009-11-18 00:28:12 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2010-10-09 13:10:37 +00:00
|
|
|
// irc "github.com/thoj/Go-IRC-Client-Library"
|
2010-01-06 18:32:35 +00:00
|
|
|
"fmt"
|
|
|
|
"os"
|
2010-10-09 13:09:59 +00:00
|
|
|
"irc"
|
2009-11-18 00:28:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2010-01-06 18:32:35 +00:00
|
|
|
irccon := irc.IRC("testgo", "testgo")
|
|
|
|
err := irccon.Connect("irc.efnet.net:6667")
|
2009-11-18 00:28:12 +00:00
|
|
|
if err != nil {
|
2010-01-06 18:32:35 +00:00
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
fmt.Printf("%#v\n", irccon)
|
|
|
|
os.Exit(1)
|
2009-11-18 00:28:12 +00:00
|
|
|
}
|
2012-05-11 11:35:25 +00:00
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo1") })
|
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo2") })
|
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo3") })
|
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo4") })
|
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo5") })
|
|
|
|
irccon.AddCallback("001", func(e *irc.Event) { irccon.Join("#testgo6") })
|
|
|
|
irccon.ReplaceCallback("001", 0, func(e *irc.Event) { irccon.Join("#testgo01") })
|
|
|
|
irccon.ReplaceCallback("001", 1, func(e *irc.Event) { irccon.Join("#testgo02") })
|
|
|
|
irccon.ReplaceCallback("001", 2, func(e *irc.Event) { irccon.Join("#testgo03") })
|
|
|
|
irccon.ReplaceCallback("001", 3, func(e *irc.Event) { irccon.Join("#testgo04") })
|
|
|
|
irccon.ReplaceCallback("001", 4, func(e *irc.Event) { irccon.Join("#testgo05") })
|
|
|
|
irccon.ReplaceCallback("001", 6, func(e *irc.Event) { irccon.Join("#testgo06") })
|
2010-10-09 13:10:37 +00:00
|
|
|
irccon.Loop()
|
2009-11-18 00:28:12 +00:00
|
|
|
}
|