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:
parent
5cf08f7e9c
commit
f6a94cc3a3
3 changed files with 103 additions and 4 deletions
|
@ -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, " "))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue