InspIRCd v4 is still early in development!

If you use this branch you may experience crashes, weird behaviour, and unannounced breaking changes.

You probably want to use InspIRCd v3 instead.

The "repeat" Module (v4)

Description

This module adds channel mode E (repeat) which helps protect against spammers which spam the same message repeatedly.

Configuration

To load this module use the following <module> tag:

<module name="repeat">

<class>

This module extends the core <class:privs> field with the following values:

Name Description
channels/ignore-repeat Allows server operators to send repetitive messages to a channel with the E (repeat) mode set.
Example Usage

Allows server operators with the class named BasicOper to send repetitive messages to a channel with the E (repeat) mode set.

<class name="BasicOper"
       ...
       privs="... channels/ignore-repeat ...">

<repeat>

The <repeat> tag defines settings about how the repeat module should behave. This tag can only be defined once.

Name Type Default Value Description
extended Boolean No Whether to use the extended mode for actions. This allows punishing users with more than just blocking, kicking and kickbanning.
message String Repeat flood (trigger is %lines% messages in %duration%) The message to kick users who repeat flood with.
maxbacklog Number 20 The maximum size that can be specified for backlog. Set to 0 to disable multiline matching.
maxdistance Number 50 The maximum percentage of difference between two lines we'll allow to match. Set to 0 to disable edit-distance matching.
maxlines Number 20 The maximum lines of backlog to match against.
maxtime Duration 0 The maximum period of time a user can set. Set to 0 to allow any period.
size Number 512 The maximum number of characters to check for, can be used to truncate messages before they are checked, resulting in less CPU usage.

The kickmessage field can contain any of the following template variables:

Variable Description
%diff% The diff from the mode value.
%duration% The seconds from the mode value as a duration.
%lines% The lines from the mode value.
%seconds% The seconds from the mode value.
Example Usage
<repeat extended="yes"
        message="Repeat flood (trigger is %lines% messages in %duration%)"
        maxbacklog="20"
        maxdistance="50"
        maxlines="20"
        maxtime="1h"
        size="512">

Channel Modes

Name Character Type Parameter Syntax Usable By Description
repeat E Parameter [~|*]<lines>:<sec>[:<difference>][:<backlog>]
{ban|block|mute|kick|kickban}:<lines>:<sec>[:<difference>][:<backlog>]
Channel operators Configures the messages that should be considered a repeat. If prefixed with ~ the messages are blocked. If prefixed with * then offending users are banned. If not prefixed then offending users are kicked.

Example Usage

Blocks more than two repeated messages in five seconds:

/MODE #channel +E 2:5

Exemptions

Name Description
repeat Allows exempted users to send repetitive messages at a higher rate than channel mode E (repeat) allows.