To create new wiki account, please join us on #znc at freenode and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

watch

From ZNC
Jump to: navigation, search

This module allows you to monitor the activity of a specific user and/or text patterns and have the text sent to a special query window. This may be handy if you, for example, want to notice any messages containing your nickname.

Usage

Arguments

This network module takes no arguments.

Read loading modules to learn more about loading modules.

Commands

Add <HostMask> [Target] [Pattern]
To add a watch entry:
/msg *watch add *!firebot@moz-8BCFA482.carolina.res.rr.com *firebot-watch
<*watch> Adding entry: [*!firebot@moz-8BCFA482.carolina.res.rr.com] watching for [*] -> [*firebot-watch]
To add a watch entry using an ExpandString:
/msg *watch add * *highlight *%nick%*
<*watch> Adding entry: [*!*@*] watching for [*%nick%*] -> [*highlight]
See ExpandString for a list of available variables which you can use in your message patterns.
SetDetachedClientOnly <Id | *> <True | False>
Only get highlighted when you're not connected to ZNC:
/msg *watch SetDetachedClientOnly 1 true
<*watch> Id 1 set to: Yes
SetDetachedChannelOnly <Id | *> <True | False>
Only get notified if the channel is detached:
/msg *watch SetDetachedChannelOnly 1 true
<*watch> Id 1 set to: Yes
SetSources <Id> [#chan priv #foo* !#bar]
To set the channels that should be logged (use space as a delimiter for setting multiple sources):
/msg *watch SetSources 1 #bugs
<*watch> Sources set for Id 1.
Results should be like:
<*firebot-watch> <firebot:#bugs> New Firefox - General bug 311883 filed by box@gmx.at.
List
To show a list of current rules:
/msg *watch list
This should produce output similar to
<*watch> ------
<*watch> Id: 1
<*watch> HostMask: *!*@*
<*watch> Target: *highlight
<*watch> Pattern: *%nick%*
<*watch> DetachedClientOnly: Yes
<*watch> DetachedChannelOnly: No
<*watch> ------
Dump
To output a list of commands that you can copy-and-paste to another instance of watch, useful for copying rules across multiple networks or users:
/msg *watch dump
This should produce output similar to
<*watch> ---------------
<*watch> /msg *watch CLEAR
<*watch> /msg *watch ADD *!*@* *highlight *%nick%*
<*watch> /msg *watch SETDETACHEDCLIENTONLY 1 TRUE
<*watch> ---------------
Del <Id>
To remove entries:
/msg *watch del 1
Clear
To remove ALL entires:
/msg *watch clear
Enable <Id | *>
Disable <Id | *>
To enable and disable rules by ID, or wildcard character * can be used for all:
/msg *watch enable 1
/msg *watch disable *
Buffer [Count]
This module can also show/set the amount of buffered lines while detached:
/msg *watch buffer
<*watch> Buffer count is set to [100]
/msg *watch buffer 256
<*watch> Buffer count is set to [256]

Example

To remove all existing watch rules, and then get notified while you are detached from ZNC if anyone mentions your default nick, alternate nick, real name, or your current nick no matter what it happens to be:

/msg *watch CLEAR
/msg *watch ADD *!*@* *highlight *%defnick%*
/msg *watch SETDETACHEDCLIENTONLY 1 TRUE
/msg *watch ADD *!*@* *highlight *%altnick%*
/msg *watch SETDETACHEDCLIENTONLY 2 TRUE
/msg *watch ADD *!*@* *highlight *%realname%*
/msg *watch SETDETACHEDCLIENTONLY 3 TRUE
/msg *watch ADD *!*@* *highlight *%nick%*
/msg *watch SETDETACHEDCLIENTONLY 4 TRUE