Flood Module

From Botnix

Overview

The flood module is designed to prevent common types of public floods which often occur on larger IRC channels. It is highly customizable and allows you to set its messages, flood thresholds and timings on a per channel (and per flood type) basis.

Configuration

These directives must be placed within a channel block. All directives are optional. If a 'flood' directive is not defined, flood checking of that type will not be active upon the channel.

 channel "#foobar" {
  flood "message" "3:6"
  flood "mode" "9:5"
  flood "nick" "2:2"
  flood "kick" "3:1"

  floodreason "message" "GACK! (<num> in <secs> secs!)"

  floodaction "message" "kick"
  floodaction "nick" "ban"
 }

The flood module supports three different directives as shown above and listed below:

  • flood: This directive indicates that flood checking of the given type should be enabled on the channel. There are four valid flood types:
  1. message: Monitor for message (and notice) floods. The message flood type will also catch actions.
  2. mode: Monitor for mode change floods. Users are penalized on a per-mode-change basis, e.g. +ooo will increment their counter three times -- use with caution!
  3. nick: Monitor for nick floods - Users will be penalized equally on all channels where the bot can see them, as nickchanges occur globally. This can result in nick flooding causing globally-reaching actions. Again, use with caution!
  4. kick: Monitor for kick floods

The second parameter to this directive indicates the limit and threshold values, for example, 3:6 means 3 messages in 6 seconds triggers a flood condition. This will be familiar to those of you who have used other bots such as eggdrop before.

  • floodreason: This directive indicates the reason to display if a user is kicked for flooding. These can be defined on a per-flood-type basis, the first parameter indicating the type of flooding this reason applies to, e.g. 'message' or 'kick'. Within the flood reason, the following values can be used and will be replaced with the relevent values (the angled brackets in this case are literal):
  1. <type>: Will be replaced with the flood type, e.g. 'message' or 'kick'.
  2. <num>: Will be replaced with the number of actions the user performed
  3. <secs>: Will be replaced with the number of seconds set on this trigger
  4. <thr>: Will be replaced with the maximum number of actions that can be performed before a flood is triggered

If this directive is not specified, a default kick message is used in the form "<type> flood (<num> in <secs> secs)" for all kicks.

  • floodaction: The action to perform when flooding occurs of the given type. The first parameter is a flood type, e.g. 'message' or 'kick', and the second parameter can be selected from the list below:
  1. kick: Kick the user from the channel using the floodreason message
  2. kickban: Kick the user from the channel using the floodreason message, and ban them
  3. deop: Deop the user if they are opped
  4. ban: Just ban the user
  5. devoice: Devoice the user if they are voiced
  6. quiet: Set a quiet-ban on servers which support it (+b ~q:host)

Commands

This module implements no commands.