diff --git a/commands.go b/commands.go index 300db9e..79287d5 100644 --- a/commands.go +++ b/commands.go @@ -359,3 +359,9 @@ func (cmd *Commands) List(channels ...string) { func (cmd *Commands) Whowas(user string, amount int) { cmd.c.Send(&Event{Command: WHOWAS, Params: []string{user, string(amount)}}) } + +// Monitor sends a MONITOR query to the server. The results of the query +// depends on the given modifier, see https://ircv3.net/specs/core/monitor-3.2.html +func (cmd *Commands) Monitor(modifier rune, args ...string) { + cmd.c.Send(&Event{Command: MONITOR, Params: append([]string{string(modifier)}, args...)}) +} diff --git a/constants.go b/constants.go index 58e9c15..ddb48ea 100644 --- a/constants.go +++ b/constants.go @@ -268,6 +268,7 @@ const ( // IRCv3 commands and extensions :: http://ircv3.net/irc/. const ( AUTHENTICATE = "AUTHENTICATE" + MONITOR = "MONITOR" STARTTLS = "STARTTLS" CAP = "CAP" @@ -288,17 +289,22 @@ const ( // Numeric IRC reply mapping for ircv3 :: http://ircv3.net/irc/. const ( - RPL_LOGGEDIN = "900" - RPL_LOGGEDOUT = "901" - RPL_NICKLOCKED = "902" - RPL_SASLSUCCESS = "903" - ERR_SASLFAIL = "904" - ERR_SASLTOOLONG = "905" - ERR_SASLABORTED = "906" - ERR_SASLALREADY = "907" - RPL_SASLMECHS = "908" - RPL_STARTTLS = "670" - ERR_STARTTLS = "691" + RPL_LOGGEDIN = "900" + RPL_LOGGEDOUT = "901" + RPL_NICKLOCKED = "902" + RPL_SASLSUCCESS = "903" + ERR_SASLFAIL = "904" + ERR_SASLTOOLONG = "905" + ERR_SASLABORTED = "906" + ERR_SASLALREADY = "907" + RPL_SASLMECHS = "908" + RPL_STARTTLS = "670" + ERR_STARTTLS = "691" + RPL_MONONLINE = "730" + RPL_MONOFFLINE = "731" + RPL_MONLIST = "732" + RPL_ENDOFMONLIST = "733" + ERR_MONLISTFULL = "734" ) // Numeric IRC event mapping :: RFC2812; section 5.3.