sigildocs

(sigil irc monitor)

(sigil irc monitor) - MONITOR command helpers (IRCv3)

MONITOR provides efficient online/offline presence tracking. Clients subscribe to a list of nicks and receive RPL-MONONLINE / RPL-MONOFFLINE notifications when those nicks change presence. This replaces the expensive WHOIS-polling pattern.

Subcommands (per https://ircv3.net/specs/extensions/monitor):

MONITOR + <nick>[,<nick>...]    add nicks to your monitor list
MONITOR - <nick>[,<nick>...]    remove nicks
MONITOR C                       clear list
MONITOR L                       list current monitored nicks
MONITOR S                       fetch current online/offline status

Server numerics:

730 (RPL-MONONLINE)    "<client> :nick!user@host[,...]"   they came online
731 (RPL-MONOFFLINE)   "<client> :nick[,...]"             they went offline
732 (RPL-MONLIST)      "<client> :nick[,...]"             list response
733 (RPL-ENDOFMONLIST) "<client> :End of MONITOR list"
734 (ERR-MONLISTFULL)  "<client> <limit> <nick>[,...] :Monitor list is full."

Exports

Construct a monitor-command struct.

Test if a value is a monitor-command struct.

Get the subcommand field of a monitor-command struct.

Get the targets field of a monitor-command struct.

Parse a MONITOR command into a monitor-command record. Returns #f on malformed input.

(parse-monitor-line (parse-irc-message "MONITOR + alice,bob"))
; => #<monitor-command subcommand: "+" targets: ("alice" "bob")>
monitor-lineprocedure

Build a MONITOR client→server line.

(monitor-line "+" '("alice" "bob"))   ; => "MONITOR + alice,bob\r\n"
(monitor-line "C")                     ; => "MONITOR C\r\n"

Build an RPL-MONONLINE (730) line. entries is a list of nick!user@host strings. Multiple targets are comma-joined per the spec.

Build an RPL-MONOFFLINE (731) line. nicks is a list of nick strings.

Build an RPL-MONLIST (732) line. May be sent multiple times if the list is large.

Build an RPL-ENDOFMONLIST (733) terminator.

Build an ERR-MONLISTFULL (734) error: server's per-user limit reached. limit is the integer limit; nicks is the rejected targets.

MONITOR-ADDvariable

(No description)

(No description)

(No description)

MONITOR-LISTvariable

(No description)

(No description)