Mwbot

mwbot is an IRC bot written by amidaniel to help on the #mediawiki support channel on the freenode IRC network. It also has its own channel, #mwbot. Source code is available at http://amidaniel.com/viewvc/trunk/MWBot/src/com/amidaniel/mwbot/?root=svn.

The (more or less) current list of factoids can be viewed at http://toolserver.org/~amidaniel/botbrain.html - see the @dump command below.

Quick help

 * !foo: displays factoid foo
 * !foo | quux: displays factoid foo, addressing the response to user quux
 * !foo is bar: defines factoid foo to be bar
 * !foo alias bar: defines foo as an alias for the factoid bar
 * !foo del: deletes factoid foo
 * @search foo.*: searches for the regular expression foo.* in all factoids
 * @trust host: trusts users on host, especially useful with IRC cloaks; host may be a regular expression
 * @untrust host: removes trust for users on host; must match an entry made with trust exactly
 * @trusted: lists trusted hosts
 * @dump: Dumps out the contents of mwbot's brain to an html file for browsing, see botbrain.

Parameters in factoids
Factoids can accept up to nine parameters, passed as space-delimited "arguments" to the factoid.


 * !foo is Hello, `1!: When expanded using "!foo bar", this will produce "Hello, bar!".
 * !foo is Hello, `e1!: URL-encodes the first parameter it receives. When expanded using "Hello, $wgGroupPermissions!", it produces "Hello, %24wgGroupPermissions!". Note that the parameters are encoded as UTF-8 which quite likely won't work for a lot of folks over IRC (may need to be changed).

Factoids can also contain other factoids "subst'ed" within them, using the following syntax:


 * !foo is Bar says `!bar``.

Any parameters of the form "`1" are expanded before internal factoids are expanded. Internal factoids can also accept parameters, for instance:
 * !foo is When you call bar with `1, you get `!bar `1``.

Sort of disgusting syntax, but it was easy to implement and hopefully not too confusing for the user :) See "!man" and "!info" for more realistic examples of how parameters are used.

Feature requests
Brainstorming sections. No guarantee anyone will ever look at this.
 * Set-up auto-rejoin feature if the bot is kicked for a netsplit or whatever. --MZMcBride 00:47, 22 February 2008 (UTC)
 * Log topic changes...? Splarka 05:23, 16 May 2009 (UTC)
 * Raise message length limit? I often find my message too long for it. --Liangent 12:47, 21 February 2010 (UTC)