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

Published:
By geannie
Category: IRC Tags: Channel Modes InspIRCd Technical Help support

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 square brackets [] 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

Mode Usage
b Syntax: /mode [#channel] +b nick!ident@host
For a ban on a user’s nickname: /mode [#channel] +b nick!*@*
For an identi ban: /mode [#channel] +b *!ident@*
For a host ban (typically the most effective): /mode [#channel] +b *!*@host.here
C Blocks CTCPs to the channel
c Blocks color codes from being sent to the channel. If set, users who send colour to a channel will receive this message: #channel :Can't send colors to channel (+c set)
i Users must be invited using /invite [nick] [#channel]
k User must specify a keyword to join the channel. Syntax: /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

User List Indicators (using default symbols and dot colours in most chat clients)

Symbol Dot Status Meaning
+ Voiced
% Halfop
@ Op
& Super Op
~ Owner
! Network Operator in channel on “official network business”; will only be used by opers for this purpose. Some clients do not recognize this mode, so the oper will appear at the top of the user list without a symbol. When the oper joins, messages will be sent to the channel stating that the person has joined on official network business, and a mode message will show that the person has been moded +Yo

Channel Status Modes

Mode Use
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 Limits 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.
Syntax: /mode [#channel] +F [num]:[sec]
f Limits messages sent to the channel per second. The user who triggers the limit 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 have auto-rejoin on kick enabled in their clients, so if the text flood is accidental the user will keep rejoining and spamming text.
Syntax: /mode [#channel] {*}[num]:[sec]
To specify a kick after 6 lines in 5 seconds: /mode [#channel] +f 6:5
To specify a ban after 6 lines in 5 seconds: /mode [#channel] +f *6:5
g Blocks messages from being sent to the channel containing a certain keyword. 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, hellow, shell, etc.
/mode [#channel] +g *foo?r* would preven anyone from sending foobar, foob4r, etc. It will only replace the character between foob and r.
j Syntax: ```/mode [#channel] +j [num]:[sec]
Limits number of joins per second. This is mostly useful during bot floods.

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}