func (q *quarid) joinChan( ev *adapter.Event, c adapter.Responder, ) { chans := q.Config.GetStringSlice("irc.channels") joinCmd := &adapter.Event{ Command: irc.IRC_JOIN, Parameters: chans, } c.Write(joinCmd) }
func writeNick(nick string, c adapter.Responder) { c.Write(&adapter.Event{ Command: IRC_NICK, Parameters: []string{ nick, }, }) timeout := make(chan bool) go func() { // Wait 400ms for an error time.Sleep(400 * time.Millisecond) timeout <- true }() <-timeout }
func (i *Client) authenticate(c adapter.Responder) { logger.Log.Infof("Authenticating for nick %s!%s", i.Nick, i.Ident) writeNick(i.Nick, c) // RFC 2812 USER command c.Write(&adapter.Event{ Command: IRC_USER, Parameters: []string{ i.Ident, "0", "*", i.Nick, }, }) }