Pissfilter is a spam filtering bot that uses rules.
Getting started
The bot can be used in the #pissfilter, #services or #opers channels by mentioning it like so: Pissfilter: help
. Logs can be accessed via #services or #pissfilter.
Rules syntax
- Regexes are formatted as
/REGEX/FLAGS
. - Strings are formatted as
"string"
. - Parameters are formatted literally (
hostmask
, for example) - Durations are formatted as a number followed by a unit (d/h/m/s), or
forever
.
The rules syntax is defined as on EVENT: CONDITION -> ACTION # COMMENT
. The comment is optional.
Valid events are:
message
: when a message is sentconnect
: when a user connectsviolation
: when a violation is addedpart
: when a user partsquit
: when a user quits
Conditions can be one of the following:
<string param> match <regex>
: Checks for a regex match.not <condition>
: Inverts a condition.<condition> and <condition>
: Takes the AND of both conditions.<condition> or <condition>
: Takes the OR of both conditions.<integer param> <gt|lt|gte|lte|eq> <number>
: Compares an integer.<string param> eq <string>
: Compares a string.
Valid string parameters are:
server
: The server the user is on.hostmask
: The hostmask of the user.message
: The message sent (message event only).gecos
: The realname/GECOS of the user.channel
: The channel the message was sent to (message/quit/part events only).type
: The violation type that triggered this event (violation event only).
Valid integer parameters are are:
connected_for
: How many seconds the user is connected for.violation <string: violation name>
: The amount of violations for the given type.
Valid actions are:
gzline <str: duration> <str: reason>
: GZ-lines the IPgline <str: duration> <str: reason>
: G-lines the IPshun <str: duration> <str: reason>
: Shuns the IPkill <str: reason>
: Kills the usertempshun
: Tempshuns the userlog <str: message>
: Log a messageviolation <str: name> <int: points> <duration: exp>
: Addspoints
to the violation countername
(name must be a string in quotes) which expire inexp
.
Commands
help
: Get a list of commandsadd <rule>
: Add a ruledel <rule ID>
: Delete a ruletest <rule IDs...>
: Test a set of rules on the last 60 minutes of events.list
: List staging ruleslist exec
: List current rulesrollback
: Rollback the staging ruleset to the current rulesapply
: Apply the current staging rules
Creating your first rule
For this example, we will be using the rule on message: channel eq "#opers" and message match /test/ -> kill # test rule
, which:
- when a message is sent,
- if the message is sent to the channel #opers, and
- it contains test,
- kill the user
You can create the rule by doing Pissfilter: add on message: channel eq "#opers" and message match /test/ -> kill # test rule
.
To test it, post "test" in opers and run Pissfilter: test <rule ID>
, and it should show you that it would have KILLed you.
To remove the rule, do Pissfilter: del <rule ID>
.