Helpful Things – Channel Modes, Bans, Exceptions, and Invex

Due to people asking a multitude of questions about user modes and channel modes, what they do, and how to use them, we’re going to post a ‘series’ involving modes that will be useful to users and channel ops alike.

This first in the series is dealing with basic channel modes and flood protection. To set a basic channel mode, you will use the following syntax:

/mode [#channel] +[mode] [additional args, if any]

{** Notes:

  1. Some of these commands have optional parameters and hard parameters. Parameters that must be set will be contained within [] and those that are optional and can be deleted are indicated by {}. Please delete brackets from commands before inputting them or your modes will not set correctly. [#channel] signifies the channel you’re setting the mode in. So if your channel is #myroom, you would replace [#channel] with #myroom.
  2. Cuff-Link runs on InspIRCd with Anope2 Services, which means that these modes, bans, and exceptions will work with any network that uses both, with the same modules active. Some modes are parallel with other IRCd software, such as UnrealIRCd, but the modes are not universal.  For the full list of modes or to reference at any time, see /helpop chmodes


Basic Modes

b /mode [#channel] +b nick!ident@host

For just a basic ban on a users nickname: /mode [#channel] +b nick!*@*
For an ident ban: /mode [#channel] +b *!ident@*

For a host based ban (this is usually the most effective ban): /mode [#channel] +b *!*

C — blocks CTCPs to the channel.

c — blocks colour codes from being sent to the channel. When this mode is set, users will see the following message come through as a notice if they try to send colour to a channel: * #channel :Can’t send colors to channel (+c set)

i — Users must be invited to be able to join the channel.

k — User must have a keyword in order to join the channel. Users would then join via /join [#channel] keyword.

n — User must be in channel to send a message to it.

N — Prevents the changing of nicknames while the channel is set to +N. This is one of the few channel modes that affects a user globally. Mostly used to combat bot nick floods.

s — Prevents the channel from showing up in a /list query.

S — Strips colour codes from all lines. This means a user can still use colour on their end, but it will be removed on the receiving end. No message is displayed to the user. The stripping is done silently.

z — If z is set, a user must be using a secure connection (SSL) in order to enter the channel. You cannot set this mode if there are any non-SSL users in the channel.

Channel Status Modes:

Statuses are as follows —

+/yellow dot — user is voiced.
%/blue dot — user is a half-op.
@/green dot — user is an op.
&/red dot — user is a ‘super’ op (Refered to in some clients as channel admin). The difference between a super op and a regular op (+o) mostly resides in the ability to create and delete akick entries with ChanServ. They can also not be deopped or kicked by a regular op (+o).
~/purple dot — user is a channel owner. With Anope2, which is the services version Cuff-Link uses, it is possible for a channel to be co-owned.
!/orange dot — this indicates a server operator (oper) has joined on “official business”, and will only be used by opers for this purpose. Some clients are not programmed to show this mode, so the oper will appear at the top of the user list without a symbol at all, but a message will appear stating that the person has joined on official network business, and a message stating that the user is +Yo.

Status modes are as follows —

m — Prevents any user that does not have +v (voice) or above on the channel from speaking.

M — Prevents any users not identified to an account (umode +r) from speaking while set on the channel including any user that is voiced/op but not currently identified to an account.

R — Prevents anyone who is not registered and identified with NickServ from entering a channel.

t — User must have +h (half-op) or above to change channel topic.

v — Gives a user a “voice”, which is useful in conjunction with +m for channel control.


F [num]:[sec] — Allows only so many nick changes per second. This mode is mostly useful in place of +N, however we recommend that to prevent nick change flooding, +N is a far quicker and more efficient method.

f {*}[num]:[sec] — Allows only so many messages to be sent to the channel per second. If triggered, the offending user will be kicked from the channel. If the * option is included, then the user will also be banned. Using the * option is useful, since many users do not have the auto-rejoin on kick option shut off in their clients, so if the text flood is accidental the user will keep rejoining and spamming text.

To specify a kick you would use /mode [#channel] +f 6:5 to kick a user after 6 lines in 5 seconds.
To specify a ban you would place an * at the start of the number:seconds for example *6:5 would ban and kick a user after 6 lines in 5 seconds.

g [keyword] — This mode blocks messages from being sent to the channel containing a certain [keyword], and these keywords may contain wildcards. To use a wildcard, you’d have to use *[key*word]* or *[key?word]*, otherwise it will not work. A * indicates any amount of characters between the two sections, and ? indicates a single character.

/mode [#channel] +g hell would prevent anyone from sending a sentence containing “hell”.
/mode [#channel] +g *hel* would prevent anyone from sending a sentence containing anything matching. So, hell, hello, shell, etc.
/mode [#channel] +g *foob?r* would prevent anyone from sending foobar, foob4r, etc. It only will replace the character between foob and r.

j [num]:[sec] — Allows only so many users to join the channel per second. This is mostly useful during bot floods. Thankfully, we don’t have to deal with much of this, but it is a good preventative measure to have in place just in case.

ExtBans [Extended Bans], Exceptions, and Invex (Invite exceptions):

Extended bans are simultaneously more complicated and simpler to use than regular host/nick/ident bans. They are frequently far more useful as well. Our example user will be Hatred, so we have something to work off of as an example. If you /whois Hatred Hatred on the server, you will see that he is “logged in as Quas”. This is the line you need to look for to use any extban, exception, or invex that requires the person’s NickServ account name. Also make note of the person’s host/vhost, in Hatred’s case, it will be “clear.metallic.unwavering”

Extbans are set in the same way as regular bans, using the /mode [#channel] +b syntax, but you would simply do /mode [#channel] +b [letter]:[argument].  To refer to the full list at any time, see /helpop extbans

“Matching” bans:

j:{status}[#channel] — user cannot join your channel if they are in the set #channel with the channel status(link to status above) you have specified, and if they are already in your channel before joining the one you have banned, it will then mute them in your channel. If no status is specified it will apply to all users in the banned channel.

For example to ban anyone in the channel #foobar /mode [#channel] +b j:#foobar
If you wanted to ban every user with voice and above in #foobar you would use /mode [#channel] +b j:+#foobar

r:[realname] — user cannot join your channel if their real name field matches. Example, Hatred’s real name field is “urxvt”, so you would just put that in there. You may also use wildcards in this field, as the real name can be set with multiple words. So if you wanted to prevent anyone from joining who has the word “smith” set, you could use r:*smith*.

R:[NickServ account] — users logged into specified account may not join the channel. So, to ban Hatred using this method, you would /mode [#channel] +b R:Quas.

Advanced Extbans:

Extbans are fairly straight forward if you just want to match a single parameter, but you can get crafty with them by stacking them up with /mode [letter]:[letter]:[parameter].

The following are “Acting” extbans. Acting bans work in conjunction with a matching extban or exception. We’ll get to exceptions in the next section.

m:[ban] — Mutes users matching the ban. Preventing them from talking and notifying them with a message that they are muted (* #channel: Cannot send to channel (you’re muted)).

So to prevent Hatred from speaking, you would do:

/mode [#channel] +b m:R:Quas to mute him by Account name.
/mode [#channel] +b m:r:*urxvt* to mute him by realname.

To mute users in your channel that are in another channel for example #foobar you would use

/mode [#channel] +b m:j:{status}#foobar

N:[ban] — users matching the specified ban may not change their nickname while on the channel. So to prevent Hatred from changing nicks, you would do:

/mode [#channel] +b N:R:Quas by Account name.
/mode [#channel] +b N:r:*urxvt* by realname.

To prevent users from another channel from changing nicknames for example #foobar you would use

/mode [#channel] +b N:j:{status}#foobar

Exceptions and Invex:

Both exceptions and invex are used primarily to let users matching certain parameters into a channel or to speak on a channel despite them matching specific modes.

Invex is used for channels that are set +i (invitation only). Normally, you would set the channel +i, and then manually use the /invite [nick] command to let the server know that it’s okay for that person to enter the channel. However, if the channel happens to be empty, and KEEPMODES is on, then no one, including the channel owner would be able to get in without being on the access list in ChanServ and manually inviting themselves using the /msg ChanServ invite user command. Invex (+I) allows users matching the given parameters to be ‘automatically invited’ to the channel without having to issue the invitations each and every time. All of the matching extbans will work with +I:

Invex matching NickServ account: /mode [#channel] +I R:[account] — to set an invex for Hatred, you would /mode [#channel] +I R:Quas
Invex matching real name: /mode [#channel] +I r:[real name] — to set an invex for Hatred, you would /mode [#channel] +I r:urxvt

Exceptions will allow a user matching certain parameters to circumvent another ban. These apply to both akick and manually set bans using +b. Exceptions work with all matching and acting extbans.

To allow a user to join when they would otherwise be banned:

/mode [#channel] +e [nick!ident@host] is the most basic.
/mode [#channel] +e R:[Account] would allow them based on their registered account.
/mode [#channel] +e r:[realname] would allow them based on a matching realname.

Every Acting extban can be matched with an exception (+e). For example, to allow a user to speak when they would otherwise be muted by +b m:

/mode [#channel] +e m:[nick!ident@host]
/mode [#channel] +e m:R:[Account]
/mode [#channel] +e m:r:[realname]

There is a warning that needs to be issued regarding +e. If a user’s +e matches an existing ban, and the user is kicked for some reason from the channel but they have auto-rejoin on, ChanServ could get confused and repeatedly kick the user from the channel, but because the +e is set, the user will just simply keep rejoining, which creates a join flood. These are incredibly annoying to deal with, but InspIRCd has a command, /remove, that removes the user from the channel without triggering the auto-rejoin function on the client’s side. It is recommended to use this command in place of /kick when needing to remove a user even if +e is not set. To do so:

/remove [nick] [#channel] {reason}

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

One thought on “Helpful Things – Channel Modes, Bans, Exceptions, and Invex”