Skip to content

Instantly share code, notes, and snippets.

@collinvandyck
Created March 24, 2013 03:36
Show Gist options
  • Select an option

  • Save collinvandyck/5230389 to your computer and use it in GitHub Desktop.

Select an option

Save collinvandyck/5230389 to your computer and use it in GitHub Desktop.
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