1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-07-01 02:53:53 +00:00

add tags parsing and CAP command, with parsing tests

This commit is contained in:
Jake Bailey 2016-01-11 16:20:06 -06:00
parent 5cf08f7e9c
commit f6a94cc3a3
3 changed files with 103 additions and 4 deletions

View file

@ -11,6 +11,7 @@ const (
DISCONNECTED = "DISCONNECTED"
ACTION = "ACTION"
AWAY = "AWAY"
CAP = "CAP"
CTCP = "CTCP"
CTCPREPLY = "CTCPREPLY"
INVITE = "INVITE"
@ -289,3 +290,13 @@ func (conn *Conn) Ping(message string) { conn.Raw(PING + " :" + message) }
// Pong sends a PONG command to the server.
// PONG :message
func (conn *Conn) Pong(message string) { conn.Raw(PONG + " :" + message) }
// Cap sends a CAP command to the server.
// CAP capability
func (conn *Conn) Cap(subcommmand string, messages ...string) {
if len(messages) == 0 {
conn.Raw(CAP + " " + subcommmand)
} else {
conn.Raw(CAP + " " + subcommmand + " :" + strings.Join(messages, " "))
}
}