| This module is a part of ZNC.
This module is shipped with ZNC by default. If you have the right "LoadMod" you can activate it with
The code for this module can be found here. This module is part of ZNC since Version 1.6
This module is used to create named command aliases on ZNC, that any connected client can use.
This user module takes no arguments.
Read loading modules to learn more about loading modules.
To view documentation about alias' commands, issue the following:
/msg *alias help
Add and Insert take an action parameter which is used as a template command. Valid substitutions in this parameter can include ExpandString tokens, as well as tokens of the format %N%, N being the index of the argument passed to the alias at the time of use. Additionally, you can precede N with a question mark (?) to make it an optional parameter, and you can follow N with a plus sign (+) to include all arguments from N onward instead of just the Nth. N is indexed at zero, so %0% is the first token received (which will be the name of the alias).
<Wug> CREATE aliasdemo <*alias> Created alias: ALIASDEMO <Wug> ADD aliasdemo PRIVMSG %nick% :%1+% <*alias> Modified alias. <Wug> ADD aliasdemo NOTICE %nick% :%1+% <*alias> Modified alias. <Wug> INFO aliasdemo <*alias> Actions for alias ALIASDEMO: <*alias> 0 PRIVMSG %nick% :%1+% <*alias> 1 NOTICE %nick% :%1+% <*alias> End of actions for alias ALIASDEMO. <Wug> INSERT aliasdemo 0 JOIN #Wug <*alias> Modified alias. <Wug> REMOVE aliasdemo 1 <*alias> Modified alias. <Wug> INFO aliasdemo <*alias> Actions for alias ALIASDEMO: <*alias> 0 JOIN #Wug <*alias> 1 NOTICE %nick% :%1+% <*alias> End of actions for alias ALIASDEMO.
Use aliases as though they were server commands. Missing parameters will be passed as an empty string if they are optional, and will generate a 461 numeric (ERR_NEEDMOREPARAMS) otherwise.
/aliasdemo This is a test #valid, %1+% expands to "This is a test" /aliasdemo #generates a 461, since required token %1+% is missing
- It is impossible for ZNC to know which channel the user is viewing, so there is no %channel% substitution. It's tough to work around this problem, but future versions may support interacting with a client side script that informs ZNC of the user's currently active channel.