SWMTBot
Contents |
Commands
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).
| Control Commands | ||
|---|---|---|
| Command | Description | Example |
| load wiki.name [interwiki] | Loads a wiki for monitoring | SWMTBot load en.wikipedia en: SWMTBot load meta.wikimedia m: SWMTBot load nl.wikimedia nl:chapter: SWMTBot load sv.wikiquote q:sv: |
| drop wiki.name | Stops monitoring a wiki | SWMTBot drop als.wikipedia |
| purge wiki.name | Removes from the database all users and watchlisted items pertaining to a particular wiki | SWMTBot purge als.wikipedia |
| batchreload | Performs reload for all currently loaded wikis. Extremely resource-intensive and thoroughly not recommended | SWMTBot batchreload |
List commandsList commands | ||
| Command | Description | Example |
| gl del username | Deletes a user from the greylist. Use this if you want to whitelist a user, but they are on the greylist. Remove them from gl and add to wl. | SWMTBot gl del Mike.lifeguard (removes Mike.lifeguard from the greylist) |
| wl add/del/show username [x=duration] [r=reason] | Adds, deletes, or shows an item on the whitelist. Set x=0 to make indefinite | (See above; wl has the same syntax as bl) |
| intel username | Shows the item on the list (listname, adder, duration and reason) if it's listed somewhere. | SWMTBot intel ZooFari (ZooFari is on commons.wikimedia admin list, added by SWMTBot until the end of time ("Auto-download from wiki")) SWMTBot intel Krinkle (Krinkle is on global whitelist, added by ZooFari until the end of time ("trusted")) |
| cvp add/del/show article name [p=wiki.name] [x=duration] [r=reason] | Adds, deletes, or shows an article on the watchlist. Leave out p= to monitor articles with the same name on all wikis; set x=0 to make indefinite | SWMTBot cvp add United States p=en.wikipedia x=0 (Adds "United States" to the en.wikipedia watchlist) SWMTBot cvp add Main Page x=0 (Adds all pages named "Main Page" on all wikis to the watchlist) |
| al add/del/show username p=wiki.name [x=duration] [r=reason] | Adds, deletes, or shows an item on the admin list on a particular wiki. Set x=0 to make indefinite | SWMTBot al add Tangotango p=ga.wikipedia x=0 (Adds Tangotango to the admin list on ga.wikipedia) |
| bots add/del/show username p=wiki.name [x=duration] [r=reason] | Adds, deletes, or shows an item on the flagged-bot list on a particular wiki. Set x=0 to make indefinite | (See above; bots has the same syntax as al) |
| bnu add/del/show regex [x=duration] [r=reason] | Adds, deletes, or shows an item on the global bad new username list. Set x=0 to make indefinite | SWMTBot bnu add Tangot.*?ngo x=128 r=vandal meme (Adds Tangot.*?ngo as a bad new username) |
| bna add/del/show regex [x=duration] [r=reason] | Adds, deletes, or shows an item on the global bad new article title list. Set x=0 to make indefinite | SWMTBot bna add index\.php r=vandal meme (Matches "index.php" as a bad new page title) |
| bes add/del/show regex [x=duration] [r=reason] | Adds, deletes, or shows an item on the global bad edit summary list. Set x=0 to make indefinite | SWMTBot bes add !{3,} r=Too many exclamation marks (Makes SWMTBot flag any edit summary with 3 or more exclamation marks) |
| getadmins wiki.name | Downloads a list of admins from the specified project and automatically adds it to the SWMTBot database | SWMTBot config getadmins en.wikipedia |
| getbots wiki.name | Downloads a list of flagged bots from the specified project and automatically adds it to the SWMTBot database | SWMTBot config getbots da.wiktionary |
| batchgetusers | Performs getadmins and getbots for all currently loaded wikis | SWMTBot batchgetusers |
- regex : If you do not know what regex means, don't use commands that have this keyword in their instructions. It could potentially cause of a lot of problems in the network by using it wrong, because commands that use regex can sometimes trigger an automatic greylist causing false positives to be made and thus (for example) an edit of an interwiki bot could be matched and then flooding channels.
Configuration
botnick- Nickname the bot will use when joining
feedchannelonircserver. Also used to identify with NickServ (so it should be a nickname registered with NickServ, but it doesn't have to be the name of the NickServ account, it could be one of the grouped aliases). botpass- Password for the NickServ account.
description- User comment as returned by /whois. The software version number is appended to this, so the usual value for this is something like or ending with "SWMTBot Version: "
partmsg- Comment used when the bot parts. It is recommended to mention a URL here to a page with more information about this bot in particular or the group it is run by (e.g. "https://meta.wikimedia.org/wiki/SWMTBot", "https://meta.wikimedia.org/wiki/CVN" or "https://wiki.example.org/wiki/Project:Countervandalism#Bots")
ircserver- Hostname of the IRC server where
feedchannelis hosted. controlchannel- A channel on
ircserver. The bot joins this channel but doesn't report anything to it by default. It is used as a way for global operators to command a bot without having to know or find thefeedchannelthe bot it is. Make sure that this channel is secured as voice or op access here would give the user the ability to send local or global commands to any bot in this channel, even if the user is not in thefeedchannel. feedchannel- A channel on
ircserver. The bot joins this channel and sends it's primary output reporting edits from the RCReader here. messages- Relative path to Console.msgs, usually "
./Console.msgs". lists- Relative path to Lists.sqlite (file is created if it doesn't exist), usually "
./Lists.sqlite". projects- Relative path to Projects.xml (file is created if it doesn't exist), usually "
./Projects.xml". broadcastchannel- A channel on
ircserver. Most installations can leave this at the magic valueNonewhich will make the bot not join anything for this. Larger installations can use this channel to synchronize the items in the database marked "global". The bot will send broadcast messages to this channel when it executes something in it's database that is "global". And it also reads broadcast messages from the broadcast channel by other bots and processes them, applying the same command to it's own database. The broadcastchannel should be very well restricted as bots read anything from this channel as a potential broadcast message (regardless of voice or op). This was done so that no accesslists have to be maintained (For example the channel could be made invite only and moderated. That way you can invite a bot to the channel to let it replicate the global database. And only give it voice when it may also send commands back to the swarm). editblank- Threshold used to determine whether an edit is to be considered a "Large removal". An edit removing more than this number of bytes will be highlighted in the feed channel. Value should be below 0. Default is "
-500". editbig- Threshold used to determine whether an edit is to be considered a "Large edit". An edit adding more than this number of bytes will be highlighted in the feed channel. Value should be above 0. Default is "
500". newbig- Threshold used to determine whether an edit is to be considered a "Large create". A page creation with more than this number of bytes will be highlighted in the feed channel. Value should be above 0. Default is "
500". newbig- Threshold used to determine whether an edit is to be considered a "Tiny create". A page creation with less than this number of bytes will be highlighted in the feed channel. Value should be above 0. Default is "
10". restartcmd- Shell command to execute when the control command "restart" is given by an op in IRC. Usually this is "nice" (with "mono SWMTBot.exe" in
restartarg), or "mono" (with "SWMTBot.exe" inrestartarg). restartarg- Shell arguments to
restartcmd.
Feed filters
These settings allow filtering of user types and event types. They are defined via the SWMTBot.ini file.
Valid values
- 1 ("show")
- Shows all items and allows autolisting of the item. This is the default value unless otherwise noted below
- 2 ("softhide")
- Hides items not notable for any reason. Does let exceptions got through and alloes items to be autolisted.
softhide users: Only show large actions or actions matching watchlist/BES/BNU etc.
softhide events: Hide actions performed by bots, admins or whitelisted users. - 3 ("hardhide")
- Hides all items. Does allow autolisting of the item.
- 4 ("ignore")
- Hides all items and item is not let into the regular flow at all (early skip)
- show/ignore is dealt with at beginning of ReactToRCEvent()
- hardhide is dealt with at end of ReactToRCEvent() (after autolistings are done)
- softhide is done inline
Filters
feedFilterUsersAnon- Actions by logged-out users (IP users, Anonymous users)
feedFilterUsersReg- Actions by logged-in users (registered users)
feedFilterUsersBot- Actions by bot users. If the username is on the CVN "bot list", then all actions by the user are handled by this feed filter. If the user is not on the CVN "bot list", then only edits with the MediaWiki "botflag" on the edit itself (b) are handled by this feed filter.
feedFilterEventMinorEdit- Edits with the MediaWiki "minorflag" on the edit itself (m). <swmt-nosofthide>
feedFilterEventEdit- (Note: This filter has no "softhide" method. value
2behaves the same as1)
Any edit that changes an existing page. feedFilterEventNewpage- (Note: This filter has no "softhide" method. value
2behaves the same as1)
Any edit that created a new page. feedFilterEventMove- Log action 'move'.
feedFilterEventBlock- (Note: This filter has no "softhide" method. value
2behaves the same as1)
Log action 'block' or 'unblock'. feedFilterEventDelete- Log action 'delete'.
feedFilterEventNewuser- Log action 'newuser', 'newuser2' or 'autocreate'.
feedFilterEventUpload- Log action 'upload'
feedFilterEventProtect- (Note: This filter has no "softhide" method. value
2behaves the same as1)
Log action 'protect', 'unprotect' or 'modifyprotect'.
Permissions
In <code>controlchannel, feedchannel and broadcastchannel permissions apply ("voiced" users in the channel can give list commands, "op" can give control commands, and it answers in the channel where the command was given).
Restart
restartcmd and restartarg are technically optional. But they must be used in pair. If one is defined, the other must be as well. Executed like this in C#:
<syntaxhighlight lang="csharp">
//Execute the custom command
System.Diagnostics.Process.Start((string)mainConfig["restartcmd"], (string)mainConfig["restartarg"]);
</syntaxhighlight>
Default if restartcmd is not defined:
<syntaxhighlight lang="csharp">
//Note: argument is not actually used, but it's there to prevent a mono bug
System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location, "--restart");
</syntaxhighlight>
Either way, after this command is executed, the Program calls "Exit()".