Created
March 24, 2013 03:36
-
-
Save collinvandyck/5230389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| flag.Parse() | |
| c := irc.SimpleClient("gesturebot") | |
| c.SSL = true | |
| c.AddHandler(irc.CONNECTED, | |
| func(conn *irc.Conn, line *irc.Line) { | |
| for _, channel := range channels { | |
| conn.Join(channel) | |
| } | |
| }) | |
| quit := make(chan bool) | |
| c.AddHandler(irc.DISCONNECTED, func(conn *irc.Conn, line *irc.Line) { quit <- true }) | |
| c.AddHandler("PRIVMSG", func(conn *irc.Conn, line *irc.Line) { | |
| messageReceived(conn, line) | |
| }) | |
| if err := c.Connect("irc.freenode.net"); err != nil { | |
| fmt.Printf("Connection error: %s\n", err) | |
| } | |
| // Wait for disconnect | |
| <-quit | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment