Collection of muh ZNC modules m8 =]

PeGaSuS 641d72b4ae Changed the module to compile with the default kick reason enabled 11 months ago
.gitignore 4ea1d11537 Updated gitignore w/ OSX bullshit 2 years ago
LICENSE 3c6587eabf initial commit 2 years ago 0e05af0acc Clarify 'user' field and default kick reason shit in le readme + optimised kickban.cpp c0dd een bit and also added een hook for OnNick(change) (requested by PeGaSuS, #1) 1 year ago
kickban.cpp 641d72b4ae Changed the module to compile with the default kick reason enabled 11 months ago
queryspam_prot.cpp 1c5948eb8b queryspam_prot: Maybe it's a good idea to actually use the full message xd (muh tokens kek) 2 years ago
regexwatch.cpp 292fd4ded5 regexwatch: Now also supports nick regexes =]]]] Also exception handling for runtime regexing xd 2 years ago
sajoin_prot.cpp 6ec5a24347 sajoin_prot: Tfw forgot to change 10 sec interval back to 120 for rep0ts xd 2 years ago
sapart_rejoin.cpp 6a88efbbe5 sajoin_prot: Fixed bug where you couldn't attach to autojoined chans (like #opers, or autocycle'd ones) 2 years ago

This is now a collection of my modules for ZNC. ;3 Everything is tested with ZNC v1.6.3, UnrealIRCd v4.0.x and Anope v2.0.x, so it may or may not work with other versions/IRCds/services.

If you don't know how2compile modules:

Index lol


Derived from autovoice, this module automatically kicks and bans people matching a certain nick!ident@host mask when people join a channel, you get re-opped or someone changes their nick.


  • adduser <user> <hostmask> [channel1,channel2,...] <reason> -- you need to add a user before you can do any of the below commands ;]
  • deluser <user>
  • listusers
  • addchans <user> <channel,[channel2[,...]>
  • delchans <user> <channel,[channel2[,...]>

The kick reason is required, unless you uncomment/change the following lines at the top of kickban.cpp and recompile it:

CString defaultKickReason = "Ayy lmao";

An example for adding an autokicker would be: /msg *kickban adduser guests Guest*!*@* * lmao ur an fuckstick. This will kick everyone with a nick like Guest13, Guest239, etc and sets a ban on the specified hostmask (Guest*!*@*). This check runs for every channel (notice the individual *).

The user field is merely the display name of that entry, it doesn't affect who it kicks. The *chans commands are for maintaining channel restrictions, so you could do delchans guests * and addchans guests #privateshit for example. ;]


Similar to watch, but this one works with ECMASCRIPT regexes. Currently it watches an entire network and channel messages/notices only (I see no point in having more hooks atm =]). The regexes are all case-insensitive.

C++ regexes require a GCC version of v4.9 or greater

Doesn't require any arguments at load time. Just load it at user or network level and add some regexes. Because of the nature of CString::Token, use \s for spaces instead of literal spaces

The module has some in-IRC commands obviously. ;3

  • add [nickregex] <regex> => Add an entry to monitor for, optionally limited to nickregex
  • del <id> => Deletes id from the regex list
  • list => List all regex patterns yo
  • test <id> [nick] <string> => Check if regex pattern id matches the message string, optionally with a nickname
  • buffer [count] => Show/Set the amount of buffered lines while detached
  • halp => Show in-IRC halp


Rejoins a channel after being SAPARTed. Since that shit actually sends a PART message on your behalf, it may get removed from ZNC entirely. The module tries to keep yo settings.

Has one optional argument delay. That shit is in seconds and defines how long to wait before tryna rejoin. It's always at least 1 so clients don't shit themselves (i.e. Textual shows the channel grayed out even though you can send messages).


Prevents your client from opening up a bunch of tabs/windows for queries when getting spammed (usually by butts).

Takes 2 arguments: threshold and timeout.
threshold is how many times a message must be seen before it gets blocked entirely (default = 5).
timeout is in minutes and defines how long this exact message will be blocked for (default = 15).

The module checks for PRIVMSGs aimed directly at you. If the message repeats more than threshold times (from any source) all messages exactly like that will be blocked for timeout minutes. This means your client will stop opening tabs/windows and you won't see any subsequent messages. =] When it gets unblocked you'll get a notification from the module.

Also, two minutes after receiving a message that wasn't classified as spam it will "cool down". This means the counter for that particular message will be reset to 0.


Protects you against forced joins (/sajoin etc). =]

This shit works by intercepting JOIN messages and verifying if you even initiated them. If you didn't then you're being SAJOINed and the mod will check if they are allowed ("trusted") channels (i.e. because you have them configured). If it's still like nope.avi it will send a PART message in response (this all is invisible to the ZNC user). This may induce some "lag" because of the IRCd throttling your shit, so bnice k?

It also reports back every 2 minutes how many channels you were tried to join into. If there are none there will be no message obviously.

Updated shit

  • Now reports back to the user how many channels they were SAJOINed into (or attempted to kek)
  • When opering up it wouldn't attach your client to the force-joined #opers but ZNC also wouldn't part it, resulting in a desync. The same happened with /cycles done by modules like autocycle. This is now fixed by temporarily holding off on joining such channels (2 seconds to be exact), then checking if you're supposed to attach to them.

Doesn't take any arguments, just load it and go. ;3

If you wanna edit the reporting timespan, you'll have to edit the source and recompile. Just look for:

netwerk->PutUser(":" + prefix + "sajoin_prot! NOTICE " + nick + " :*** Over the last 2 minutes you were (tried to be) SAJOINed into " + count + " channels");
AddTimer(new CReportTimer(this, 120, 0, "sajoin_prot_report", "sajoin_prot_report"));

And change the 120 to the amount of seconds it should wait for its next report. May also wanna adjust the message it sends you. =]