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.


From ZNC
Jump to: navigation, search


Modules are used to extend and modify the way ZNC functions. Users interact with modules most commonly by messaging a special user on IRC. For example, to view the highlight keywords in your watch list, you'd send /msg *watch list. When ZNC sees that the nick you're messaging starts with an asterisk, it doesn't forward the message to the IRCd/server but instead sends it to the proper module for processing. In this case, the watch module will get the message and reply to you with a listing of your keywords. This makes for a very convenient and standard way of configuring or otherwise communicating with your loaded modules, as well as a common and standard way for your loaded modules to display status or other information. Notice that this is for loaded modules. You must load a given module, for example /znc loadmod watch, before you can interface with the watch module. Most modules will reply to /msg *module help with a listing of available commands.

ZNC modules are loaded either globally, per-network, or on a per-user basis. Each module defines for itself whether it is available to load as global, network-specific and/or user-specific. User level and network modules can do things ranging from manipulating the incoming/outgoing messages to implementing a full blown Twitter client. They can also do more traditional IRC tasks such as challenge based auto-op, setting you away, or logging to disk. Each user gets to load and configure their own set of modules to customize their experience to suit their preference.

Global modules are loadable by admins and provide functionality or change behavior for all users. For example, the partyline module has to be global since it provides functionality for all users on a given ZNC instance to be able to communicate with each other from within ZNC itself. Global modules can do everything that user-level modules can do, as well as a few extras. They can replace ZNC's authentication system, modify the config-writing process, deal with CAP, etc.

The modules can also hook into ZNC's web interface and provide web content. The most common web module is webadmin which allows admins to add/remove users and allows users to configure their settings from a browser.


ZNC modules are written in C++ natively. There are also a couple of modules that embed an interpreter to allow you to load Perl, Python, or Tcl modules. To learn more about creation of modules you should read Perl Modules, Python Modules, TCL Modules, or C++ Modules.

Feel free to create wikipages about modules you have created, but don't forget to add a download link, contact information, and use the same layout as the rest of the modules. Contributions are always much appreciated.

Module List

Global Modules

Log user connects, disconnects, and failed logins to a file and/or to syslog.
Blocks certain users from using ZNC, saying their account was disabled.
This module lets users to log in via SSL client keys.
This module is intended for admins who run a shell/web/email/etc server and want to provide ZNC access to their existing users.
Block IPs for some time after a failed login.
Posts the ident of a user to a file when they are trying to connect.
Allow users to authenticate via IMAP.
Logs when a user last logged in to ZNC.
Loads Perl scripts as ZNC modules.
Allows you to use modules written on Python.
Sends a notice to all admins when a user logs in or out of ZNC.
Allows ZNC users to join internal channels and query other ZNC users on the same ZNC.
(Now cyrusauth) Allows users to authenticate via SASL.
Allows you to add/remove/edit users and settings on the fly via a web browser.

User Modules

(Now controlpanel) Allows you to add/remove/edit users and settings on the fly via IRC messages.
Watches your detached channels and reattaches you automatically when there is specified activity in a channel you added to your autoattach list.
Gives a automatic reply if someone messages you while you are away.
Blocks the server's Message of the Day.
Bounces DCC transfers through the znc server instead of sending them directly to the user.
Add nick changes, joins, parts, topic changes etc. to your playback buffer.
Saves channels to config when user joins and parts.
Normalizes (i.e. converts) character encodings.
This module attempts to bridge the gap between being inundated with old buffer if you have KeepBuffer=true; and possibly missing messages when you ping out, if you have KeepBuffer=false.
Notify about new incoming connections to your user.
Allows you to add/remove/edit users and settings on the fly via IRC messages.
This module tries to block CTCP floods.
This module allows you to transfer files to and from ZNC
This module will kick your client from all channels if ZNC disconnects from server.
This module detaches you from channels which are flooded.
This module displays a list of all open sockets in ZNC.
Log chat activity to file.
This user module will send 422 to clients when they login.
Keep and replay notes. This is an example of WebMods.
This is an example module to help with writing modules to do whatever you want.
Allows you to send raw traffic to IRC from other users.
Access your Unix shell via query right inside of your IRC client.

Network Modules

Rejoin a channel when you are the only one there (to gain operator status).
Automatically give operator status to the good guys.
Allows you to run Tcl scripts in ZNC.
Automatically give voice status to everyone who joins some channel.
Change your nick while you are away.
When you are set away or detached, this module will save all private messages for you. The messages can be read until you delete them. This module will also set you away when you are idle some time.
This module lets users use their own SSL certificate to connect to a server.
Encryption for channel/private messages.
Tries to get and keep your primary nick if it is taken.
Implements auto-rejoin-on-kick.
Fakes online status of ZNC modules to fix some clients.
Auths you with NickServ.
Performs commands on connect.
Auths you with Q (and a little more).
View all of the raw traffic.
Routes back answers to the right client when connected with multiple clients.
Allows you to authenticate to an IRC network via SASL
Saves your channel buffers into an encrypted file so they can survive restarts and reboots.
SSL (encrypted) DCC chats.
Automatically set you away on IRC when disconnected from the bouncer.
Keeps you in specified channels.
Monitor activity for specific text patterns from specific users and have the text sent to a special query window.

More Modules

For more modules, see Category:Modules.

Managing Modules

Modules can be added or removed easily. Modules can be stored in ~/.znc/modules and /usr/local/lib/znc by default. ZNC installs its modules to that second directory, which in fact is ${prefix}/lib/znc, but this can be changed with ./configure --module-prefix=DIR before compiling.

ZNC will first look in the local sub-directory modules when searching for modules. Only files that end with ".so" will be seen as a module. To remove modules you can simply delete them from the folder. No other configuration changes or restarts are necessary. To remove, but also keep a module for later use you can also change the name, like: mv sample.so_.

To compile a new module you must first save the source as a ".cpp" file. Compiling modules describes the process in detail.

(Un)Loading Modules

Global, user, and network modules can be (un)loaded from webadmin or via the *status query window, like:

/msg *status LoadMod [--type=global|user|network] <module> <parameters>
/msg *status UnloadMod [--type=global|user|network] <module>
  • * is the StatusPrefix set in your configuration. Usually it's just an asterisk ("*").
  • [--type=global|user|network] optionally specifies whether to (un)load the module as a global, user, or network module. Not all modules can be loaded at all levels; see individual Module documentation to find out where it may be loaded.
  • <module> is based on the modules file name, excluding the ".so" extension.
  • <parameters> are specific for each module and not required: You can provide parameters when loading the module, or you can set up the module after loading it.

So, to load the log module at the global level (as opposed to user or network) and remove all color/formatting control codes with the -sanitize parameter, you would type:

/msg *status LoadMod --type=global log -sanitize

For older versions of ZNC, you won't have the option to specify [--type=global|user|network]. In that case, just use:

/msg *status LoadMod <module> <parameters>
/msg *status UnloadMod <module>

Please keep in mind that a user is not able to load a module if the directive "DenyLoadMod" is set to true. Trying to load a module will fail with "Unable to load [<module>] Access Denied.".

If a module prevents ZNC from starting up and therefore you can't unload the module using webadmin, you can edit znc.conf and remove the corresponding LoadModule line.

Using modules

It is recommended to read the module's wikipage if you want to find out how a module works. Alternatively the following command can be used to get a command list:

/msg *<module> help
  • * is the StatusPrefix set in your configuration. Usually it's just an asterisk ("*").

External modules

Below is a partial list of popular external modules. Please see Category:External Modules for a comprehensive list.

Filters amsgs from specified channels.
Hides your idle time.
Push private messages and highlights to your iPhone/iPod Touch via Colloquy Mobile.
Monitors email activity on local disk /var/mail/user.
FiSH encryption for channel/private messages.
Send private messages and highlights to your mobile devices using various push notification services. Includes a highly configurable set of conditions to control how and when notifications get sent.
Implements a Twitter client. It can post new tweets and monitor searches, users, timeline and @mentions.