Extended bans

Extended bans (ban conditionals) allow different checks than the usual nick!user@host or nick!user@ip match to determine whether someone should be banned, quieted, exempted or invited.

Extended bans are of the form $[~]<type>[:<data>]. The <type> is one character (case insensitive) and determines the type of match. Most types allow or require an extra field <data>. If the tilde (~) is present, the result of the comparison will be negated, unless the ban is invalid in which case it will never match.

Note: Extended ban types also work with +e (ban exemption), +q (quiet ban), and +I (invite exception). Check channel modes for more information.

Syntax: /mode <channel> [+/-]b/e/q/I $[~]<type>[:<data>]

$a – logged in users
Syntax: /mode <channel> [+/-]b/e/q/I $a:<mask>
Example: /mode #channel +b $a:username
Matches users logged in with a username matching the mask (* and ? wildcards).

The above example will ban shadow when he is identified to his nick, regardless of the nickname he is using at the time.

$c – channel
Syntax: /mode <channel> [+/-]b/e/q/I $c:<other channel>
Example: /mode #channel +b $c:#channel2
Matches users who are on the given channel; this is only valid if the channel exists and is not +s or +p. (The ops of the channel the ban is on cannot necessarily see whether the user is in the target channel, so it should not influence whether they can join either.)

The above example will prevent users in #channel2 from joining the #channel.

$j – shared banlists
Syntax: /mode <channel> [+/-]b/e/q/I $j:<other channel>
Example: /mode #channel +b $j:#channel
Bans anyone who is also banned in the specified channel. Also works for ban exemptions, quiet bans, and invex’s.

The above example will ban anyone in #channel who is also banned from #rmxp.

$o – IRC Operators
Syntax: /mode <channel> [+/-]b/e/q/I $o
Example: /mode #staff +I $o
Matches opers (most useful with +I).

The example above, with the +i mode on, will only allow IRC Operators to join.

$r – gecos (realname)
Syntax: /mode <channel> [+/-]b/q $r:<mask>
Example: /mode #channel +b $r:Real?name
Matches users with a realname (gecos) matching the mask (* and ? wildcards); this can only be used with +b and +q.

The above example bans users with the gecos “Real name”.

$s – server
Syntax: /mode <channel> [+/-]b/q $s:<mask>
Example: /mode #channel +b $s:us.ircworld.org
Matches users connected to a server matching the mask (* and ? wildcards); this can only be used with +b and +q.

The above example bans users connect to the server us.ircworld.org.

$x – extended
Syntax: /mode <channel> [x/-]b/e/q/I $x:<nick>!<ident>@<host>#<gecos>
Example: /mode #channel +b $x:nick!ident@staff.ircworld.org#Real?name
Extended bans match an entire hostmask, including the user’s “gecos” (real name). Wildcards are allowed.

The above example bans the nickname “Nick”, with the ident “ident”, the hostmask “staff.ircworld.org”, and the gecos “Real?name”.

With a ~ (Tilde)
A tilde will cause the result of the comparison will be negated.

Example: /mode #channel +b $~o
Will ban anyone who isn’t an IRC Operator.

Example: /mode #channel +b $~c:#channel
Will ban anyone who isn’t also in #channel.

Leave a reply

You must be logged in to post a comment.