MediaWiki Administrator's Handbook/Countervandalism IRC Bots

This page documents two bots used extensively by countervandalism channels.

Bot overview
Computer was the original recent changes filtering bot written as a mIRC script, developed by White Cat. It was replaced by pgkbot in 2005.

pgkbot is a python bot developed by pgk. It is designed for use in one channel, and includes a number of customization options such as plugin support, complex event routers, individual lists, individual user name and article title watchlists, detection of page move vandalism, and IP address categories (like open proxies). However, configuration is difficult and it is relatively resource-intensive.

SWBot is a C# bot developed by Tangotango and Az1568. It is designed for use in networked or multiwiki channels. Features include dynamic loading and unloading of wikis and channels, a central configuration file and database, global lists, auto-broadcast of global changes to all other SWBot instances, and detection of page blanking and replacement using automated MediaWiki summaries. However, per-channel event configuration is not possible.

CVNbot is a unified centralized bot written in Perl by Pathoschild. It is currently in development and not actively used. The bot is intended to facilitate channel network administration and provide edit monitoring, without extraneous features.

pgkbot

 * Common bots: ErosionBot-1, MiszaBot, TheDJBot, ClueBot(RC).

Using commands
Commands are issued to the bot by appending their name or "computer" to the beginning of the line. If you append the name, the command will only be recognized by the bot named. If you append "computer", all bots present will recognize the command. For example, if you want to add a user to pgkbot's blacklist, you would say  . Alternately, you could add the user to the blacklist of every bot in the channel. This is recommended, as it synchronises the backup bots. To do this, you would say  .

Which commands a user can issue depends on which list they are in.

Lists of users
The bots maintain several lists of users, which can be reported, formatted, and treated differently from each other.


 * Admins: this is a list of admins on the project. The relevant command is  .
 * Whitelist: this is the list of trusted users. The relevant command is  .
 * Greylist: this is a temporary blacklist which the bot automatically populates with users that have recently been reverted, or matched one of the bnu list expression. Entries can be removed from the list, but cannot be added manually.
 * Blacklist: this is a list of suspicious users. All edits by blacklisted users are reported. The relevant command is  .
 * Bots: this is a list of bots on the project. The relevant command is  .

Reference table
This table is a quick overview of commands. For additional help, address the following command to pgkbot on IRC:  . There are two optional flags which can be used with most commands. These can be used by appending them to the end of the command (expiry must be stated before the reason, if both are used).
 * " " provides a reason. This is useful for other users, who may not know why something has been added to the list without.
 * " " provides an expiry time in hours. After the specified number of hours, the command will be automatically undone.

Note that the symbols "[|]" are used in the table; these symbols should not be used with the bot (for example, use "pgk add blah" and not "pgk [add] blah"). Multiple possible actions are denoted as [option 1|option 2]; only one can be used at a time. Values are designated as ; all strings accept regex.

Settings
These settings affect the way the bot filters the raw recent changes to the reported events. They are viewed with the command   and modified with the command  .

Event report toggles
These options toggle which events are reported to the channel. They are accessed with the command   and  . The events are listed below. Each event will only be reported to a channel once, irrespective of fitting into several of these categories.

"Actions" in the tables below refer to all visible changes to the database, including edits, page moves, and deletions.

Pre-requisites

 * Python: The bot requires the python environment to run, which is freely available from the python.org download page. It is recommended that you install for all users to C:\Python with all options enabled.
 * Twisted: Also required is the Twisted python library, available from the official website.
 * Note - Pgkbot can only work with Python version 2.4 or 2.5 and will not work with older versions.

Download

 * 1) Download the latest public version of pgkbot (1.7) from pathos.ca/tools/pgkbot.
 * 2) Unzip it to C:\pgkbot.

Configure
There are a few text files that need to be edited before use.

Run the bot

 * 1) Open a DOS prompt.
 * 2) Navigate to the directory pgkbot is installed in.
 * 3) Type in c:\python24\python.exe CVUBot.py en.
 * 4) pgkbot will be silent upon connecting. Be sure to make it speak and route some events (see above).

SWMTBot

 * Common bots: SWBot* (except SWBot2), SWMTBot*, TheDJBot(3-5).

Comparison with pgkbot
SWMTBot is a port of pgkbot to C#, specially made to suit the needs of the Small Wiki Monitoring Team and other users who monitor a large number of feeds in one channel. Most commands have been kept identical to their pgkbot equivalents except where necessary; messages have also been kept as close to pgkbot's as possible.

Lists
All global lists are automatically synchronized across all SWMTBots; per-wiki lists are not. There is a global article watchlist for all wikis, and one for each one; you can add/delete/show items on the global list by leaving out the "p=" parameter (see the command lists below for more information).

Installation
SWMTBot is tested and actively developed to work on Mac OS X, Linux (Debian), and Windows. The software is licensed under the MIT License.

CVNbot
See CVN/CVNbot.

Support

 * #countervandalism for bots in channels operated by the countervandalism network
 * pgkbot
 * pgk— For comments, suggestions, and troubleshooting the bot script.