func PingHandler(s *irc.Encoder, m *irc.Message) { s.Encode(&irc.Message{ Command: irc.PONG, Params: m.Params, Trailing: m.Trailing, }) }
func addChannel(f []string, s *irc.Encoder, name string) []string { f = append(f, name) s.Encode(&irc.Message{ Command: irc.JOIN, Params: []string{"#" + name}, }) return f }
func removeChannel(f []string, s *irc.Encoder, name string) []string { var index int for i, v := range f { if v == name { index = i } } f = append(f[:index], f[index+1:]...) s.Encode(&irc.Message{ Command: irc.PART, Params: []string{"#" + name}, }) return f }
func send(encoder *irc.Encoder, msg *irc.Message) error { logSend(msg) return encoder.Encode(msg) }