Web plugin.
[supybook.git] / index.txt
blobe9a0c94ef5c5fa8ff13201cce115052c422c75c9
1 Supybook
2 ========
3 Heikki Hokkanen <hoxu@users.sf.net>
4 {date}
5 {revision}
7 == Preface ==
9 NOTE: At the time of this writing, Supybot version is 0.83.3. If you are using a newer (or even older) version, keep that in mind.
11 NOTE: This document is very much a work in process. It covers nowhere near everything there is to Supybot. However, it hopefully allows a good start into learning Supybot.
13 === What is this document? ===
15 This document is a handbook for http://supybot.com/[Supybot], the IRC (http://en.wikipedia.org/wiki/Internet_Relay_Chat[Internet Relay Chat]) bot written in Python.
17 === Motivation behind this document ===
19 Some time ago I started needing an IRC bot for various purposes. The bot would have to be able to take care of auto-opping and similar "traditional" channel duties. This made me think of http://oer.equnet.org/[Oer], an old but very nice bot. However, I also wanted to have factoid functionality similar to http://blootbot.sourceforge.net/[blootbot]/http://infobot.org/[infobot], without having to run multiple bots. That was when I arrived at Supybot once again. This time I decided to give it a closer look.
21 My experience of the documentation was lacking though. I longed for something similar to http://oer.equnet.org/um.php[Oer's User Manual] that provides a quick references for basic administrator tasks and so forth. Alas, I could not find such document.
23 I figured I could as well wrap up such a handbook while learning to use the bot myself. Hopefully someone finds reading this document as useful as writing it was.
25 === Conventions used in this document ===
27 `command <name> [value]`::
28         A command that takes `name` as a required parameter and `value` as an optional parameter.
30 `command <nick...>`::
31         A command that takes one or more parameters.
33 `command [\--{foo,bar}] <value>`::
34         A command that takes two optional options as parameters, eg. `\--foo value` and/or `\--bar value`.
36 [green]#Plugin#::
37         A plugin name
39 === This document is Free ===
41 This document is Free (TM) as defined by the http://www.fsf.org/[Free Software Foundation], more specifically, this document is available under the terms of http://www.gnu.org/licenses/gpl-3.0.txt[GNU General Public License version 3 (GPLv3)]. The source is a text file that can be converted to various formats by http://www.methods.co.nz/asciidoc/[asciidoc].
43 === How to give feedback ===
45 If you spot an error, have suggestions or just want to tell me how much you love/hate the document, send e-mail to mailto:hoxu@users.sf.net[]. Prefix the Subject with `[supybook]`.
47 == Getting started ==
49 === Initial configuration ===
51 Create a new directory (eg. `mkdir ~/supybot`) and run `supybot-wizard` in it. Follow the directions to get the bot initially configured.
53 Once you are ready with the wizard, I suggest you start the bot inside screen:
55 ----
56 $ screen
57 $ supybot configFile
58 ----
60 This way you can attach to the screen later to see the messages it writes to stdout, while still running the bot in the background. Alternative is to run it in the daemon mode, `supybot \--daemon configFile`.
62 You can set up a crontab to start the bot automatically, for example:
63 ----
64 $ crontab -e
65 > @reboot screen -d -m supybot /path/to/configFile
66 ----
68 === Identifying to the bot ===
70 After running supybot-wizard and starting the bot, connect to the same IRC network it is on, and /query it. You can identify with the `identify <name> <password>` command. You can check the bot's idea of who you are with the `whoami` command.
72 NOTE: All commands that contain a `password` must be sent to the bot in private.
74 === Accessing the online help ===
76 Most commands on the bot have a short online help available. You can use `list` to list loaded plugins, and `list <plugin>` to list commands in those plugins. `help [plugin] <command>` can be used to access the command help. Use `more` to read long messages from the bot.
78 Help for configuration items can be accessed with the `config help <key>` command.
80 == Understanding supybot's peculiarities ==
82 Supybot has a couple of features that sets it apart from more traditional bots. More specifically, nested commands, plugin framework (even the basic functionality is implemented using plugins), and capabilities. This section covers some basic information about Supybot. Feel free to skip it, but come back later if you run into something you don't understand.
84 === Nested commands ===
86 Supybot allows nested commands, in other words, you can pass the result of a command to another command as a parameter. What does this allow then, though, apart from the obvious bragging rights? For example, if you want to restore a configuration entry to the default value, you can type:
88 `config reply.withNickPrefix [config default reply.withNickPrefix]`
90 Obviously, that wasn't very neat. They could've included a `config reset <key>` command instead, for example. But I'm sure you can figure out *something* more useful to do with this, as a homework ;-)
92 === Plugins ===
94 Pretty much everything in Supybot is a plugin. Most commands you use belong to a plugin. If two plugins provide the same command, then you need to prefix the command with the plugin name. For example, the `ignore list` command yields the following output:
96 .output
97 ----
98 Error: The command "ignore list" is available in the Admin and Channel plugins.
99 Please specify the plugin whose command you wish to call by using its name as a command before "ignore list".
100 ----
102 Thus, you need to either use `admin ignore list` or `channel ignore list` command. That is, unless you define which plugin is the default one using the `defaultplugin [\--remove] <command> [plugin]` command provided in the [green]#Owner# plugin.
104 The `list` command ([green]#Plugin#) can be used to list loaded plugins. You can prevent some plugins from showing in the list with the command:
106 `config plugins.<plugin>.public False`
108 WARNING: This does not really make the plugins private. They can still be listed by unregistered users (unless they have anticapability for `list`). This is a bug in my opinion.
110 `list`::
111         List currently loaded plugins, excluding the ones set non-public.
113 `list \--private`::
114         List loaded plugins that are set to non-public.
116 `list <plugin>`::
117         List commands provided by the given plugin.
119 `load [\--deprecated] <plugin>`::
120         Load a plugin. Supybot looks for plugins in directories listed in `config conf.supybot.directories.plugins`.
122 `unload <plugin>`::
123         Unloads a plugin. The [green]#Owner# plugin cannot be unloaded.
125 NOTE: Plugins can store information in a database. By default, the database is channel-specific. This can be changed by modifying `config databases.plugins.channelSpecific` to be global. The config item can also be set on per-channel basis.
127 === Configuration ===
129 Most of Supybot configuration is done online using the [green]#Config# plugin. This excludes things such as granting the owner capability (must be done by modifying the files).
131 There are two types of configuration items: global and channel-specific. The latter are actually no different from the global ones, except that they can be set for channels as well. This means you can have a global default which is overridden for specific channels.
133 Configuration items are hierarchical. The "root" item is `supybot`, which can be omitted. Configs for plugins live under their own key, `supybot.plugins`, or shortly, `plugins`.
135 `config <name> [value]`::
136         Get the current value of `name`, or set it to `value` if provided.
138 `config channel [channel] <name> [value]`::
139         Ditto, but for channel configs.
141 `config default <name>`::
142         Get the default value of `name`. This does not change the value. No, there is no command to reset an item to default value. You need to use `config <name> [config default <name>]` for that.
144 `config export <filename>`::
145         Export non-confidential parts of configuration to a file for debugging purposes.
147 `config help <name>`::
148         Show help for a configuration item.
150 `config list <group>`::
151         List configuration items in `group`. Subgroups are prefixed with '@', channel-specific items with '#'.
153 `config reload`::
154         Reloads configuration. Mostly useful if you've had to modify the files by hand.
156 `config search <word>`::
157         Show configuration items matching `word`.
159 NOTE: Some of the sections in this document have a list of related configuration items. They are listed similarly to the table below. In this example the config value could be modified with the `config plugin.example.foo <True|False>` command. If the key is prefixed with `#`, the config value can be set both globally and on channel-specific basis.
161 .plugin.example
162 `15`15`70~~~
163 Key,Default,Description
165 foo,True,Example key.
166 #bar,False,Example key that can be set on channels as well.
169 [[capabilities]]
170 === Capabilities ===
172 Many traditional IRC bots manage permissions of users using flags. Some network services in fact, do, too. Each user can have various flags on each channel. The flags can mean auto-op, op, use of !ban command and so forth. On side of those, there are often global user flags that entitle the user to full access, global auto-op, etc. Some bots also support channel flags that determine what bot functionality is available on the channel.
174 Supybot does not have any flags. Instead, the permissions are managed using 'capabilities'. There are two kinds of capabilities: `user capabilities` and `channel capabilities`.
176 'User capabilities' are checked first when a user tries to run a command. If the user has an 'anticapability' for the command (eg. `-command`, `-Plugin.command`) or the Plugin (`-Plugin`), it won't be run.
178 Next, if the command was run on the channel, the 'channel capabilities' are checked. The logic is same as above, but the checked capabilities are prefixed with `#channel,`, for example `#channel,-Plugin.command`.
180 There are some special capabilities recognized by Supybot:
182 `owner`::
183         For bot owners: the people who have "physical" access to the bot and its files. This cannot be granted online; the 'conf/users.conf' file must be edited by hand followed by `reload`. Owners are exempt from `#channel,op` capability checks and channel anticapabilities.
185 `admin`::
186         For bot administrators. Users with this capability can manage global bot properties, make the bot join new channels and so forth. However, they can't do channel administration which is reserved for ops.
188 `#channel,op`::
189         Channel ops can execute channel-related commands.
191 `trusted`::
192         Allow user to run commands that can potentially crash the bot, or cause denial of service on the system it's running on.
194 Commands used to manipulate capabilities are covered in the <<channel-capabilities,Manipulating channel capabilities>> and <<user-capabilities,Manipulating user capabilities>> sections.
196 == Administrative tasks ==
198 === Networks ===
200 Related plugins: [green]#Network, Services#.
202 ==== Adding a network ====
204 `network connect [--ssl] <network> [<host[:port]>] [password]`::
205         Connect to `network`. `host` must be provided if the network is new or has no servers defined.
207 ==== Reconnecting ====
209 `reconnect [network] [message]`::
210         Disconnects and connects `network`, or current if not specified. `message`, if given, is shown as the quit message, otherwise `config plugins.Owner.quitMsg` is used, or your nickname.
212 ==== Disconnecting ====
214 `network disconnect [network] [message]`::
215         Disconnect `network`, or current if not specified. `message` as above.
217 ==== Listing networks ====
219 `networks`::
220         List of networks & servers currently connected to.
222 .output
223 ----
224 freenode: wolfe.freenode.net and ircnet: irc.elisa.fi
225 ----
227 `config list networks`::
228         List all networks.
230 ==== Adding more servers ====
232 Once you've added a network with the initial server, you can add more servers:
234 `config networks.<network>.servers [config networks.<network>.servers] server:6667`
236 ==== Listing network servers ====
238 `config networks.<network>.servers`
240 .output
241 ----
242 chat.freenode.net:6667
243 ----
245 ==== Services: NickServ ====
247 WARNING: My pratical experience with [green]#Services# plugin on Freenode is... not-so-good. It definitely does not work all the time as expected.
249 You can make Supybot identify itself to the network NickServ after it has connected.
251 `config plugins.Services.noJoinsUntilIdentified True`::
252         Settings this is useful on Freenode and other networks who change the user mask after identifying to NickServ. In my experience this seems to be a tad buggy, so I don't recommend enabling it unless really needed.
254 `config plugins.Services.NickServ NickServ`::
255         Tell the bot what name NickServ can be found under.
257 `services password <nick> [password]`::
258         Can be used to set or remove NickServ password.
260         NOTE: Password removal did not work for me on Supybot 0.83.3
261         
262 `services identify`::
263         Identifies the bot to NickServ with the current nick. You don't need to give this command after the bot has been set up; it will identify when connecting to the network automatically.
265 ==== Services: ChanServ ====
267 You can make Supybot request op after joining a channel on a network with ChanServ.
269 `config plugins.Services.ChanServ ChanServ`::
270         Tell the bot what name ChanServ can be found under.
272 `config plugins.Services.ChanServ.op <on|off>`::
273         Set the default for all channels. This will be used unless a channel-specific config overrides it.
275 `config channel [channel] plugins.services.ChanServ.op <on|off>`::
276         Set to request op on the given `channel`.
278 Voice and half-op (on networks supporting it) can be used similarly.
280 === Channels ===
282 Related plugins: [green]#Channel#.
284 NOTE: Commands in this section (such as adding/removing channels) work in the current network, eg. the one you are messaging the bot in. The commands also accept a `[channel]` parameter which is needed only when the command is written in private.
286 NOTE: If you want to /msg the bot in one network, while having the command apply in another network, you can use the `network command <network> <command> [params]` command. The reply comes in the other network if you are there as well.
288 WARNING: The `network command` command does not seem to check if the user having your nick in the other network is recognized (eg. identified or recognized by hostmasks), so the reply may end up to someone else.
290 ==== Adding a new channel ====
292 `join <channel> [key]`::
293         Joins the `channel` using `key` if provided. Channels are automatically remembered and joined when the bot connects to the network next time.
295 NOTE: `config plugins.Channel.alwaysRejoin` determines whether the bot will (attempt to) rejoin the channel when kicked out (the default).
297 ==== Listing channels ====
299 `channels`
301 NOTE: This only works in private, to prevent knowledge of top secret channels from falling into wrong hands.
303 You can list channels in another network with `config networks.<network>.channels`. Or with `network command <network> channels`.
305 ==== Removing a channel ====
307 `part [channel] [reason]`::
308         Makes the bot leave `channel`, showing `reason` as part message if given. Note that all channel data is retained, but the bot does not join the channel anymore the next time it connects to the network.
310 ==== Modifying channel config ====
312 `config channel [channel] <name> <value>`::
313         Sets config item `name` on `channel` to `value`, overriding the global value.
315 ==== Setting the key ====
317 `channel key [channel] [key]`::
318         Sets key on `channel` to `key`, or removes it if `key` is not given.
320 ==== Setting the limit ====
322 `channel limit [channel] [limit]`::
323         Sets limit on `channel` to `limit`, or removes it if `limit` is not given (or is zero).
325 ==== Channel commands ====
327 Channel ops can use the following commands to control the channel via the bot, assuming it is opped.
329 `op [channel] [nick...]`::
330         Ops the given nicks (or you if none) on the channel.
332 `deop [channel] [nick...]`::
333         Ditto, but deops.
335 `voice [channel] [nick...]`::
336         Voices the given nicks (or you if none) on the channel.
338 `devoice [channel] [nick...]`::
339         Ditto, but devoices.
341 `kban [channel] [\--{exact,nick,user,host}] <nick> [seconds] [reason]`::
342         Bans and kicks the given nick from the channel. If `seconds` is specified and is not 0, the ban will expire after that time.
344 `mode [channel] <mode> [params]`::
345         Set channel mode. This can be used to change any channel modes, making the commands below redundant aliases.
347 `moderate [channel]`::
348         Set +m. This is not enforced by the bot, so any channel op can remove it.
350 `unmoderate [channel]`::
351         Set -m.
353 `topic lock [channel]`::
354         Set +t. Not enforced, so any channel op can remove it.
356 `topic unlock [channel]`::
357         Set -t.
359 `alert [channel] <text>`::
360         Sends `text` to all users on the channel with op capability.
362 `cycle [channel]`::
363         Make the bot part and join the channel. Mostly useful to test whether auto-ops from other bots/users work for the bot.
365 ==== Maintaining the ban list ====
367 `ban add [channel] <nick|hostmask> [expires]`::
368         Add ban for given nick or hostmask on the channel. If nick is given, the full hostmask is banned. `expires` when gives, expires the ban after so many seconds.
370 `ban list [channel]`::
371         List bans with their expire times.
373 `ban remove [channel] <hostmask>`::
374         Removes the ban on given `hostmask`.
376 `config plugins.Channel.banmask <string>`::
377         Hostmask style for `ban add`: `exact`, `nick`, `user`, `host`. This means which parts of the nick's current hostmask are used (rest are wildcarded). Default is `host user` (eg. `*!user@host`).
379 NOTE: Users matching the ban list are not automatically kicked off the channel. See the `kban` command in the previous section to kick and ban a user.
381 ==== Maintaining the ignore list ====
383 `channel ignore add [channel] <nick|hostmask> [expires]`::
384         Ignores `hostmask` (or the full hostmask `nick` currently has) on `channel`. If `expires` is given, the ignore expires after that many seconds.
386 `channel ignore list [channel]`::
387         Show ignored hostmasks on `channel`. This does not show the expire times, though (argh!).
389 `channel ignore remove [channel] <hostmask>`::
390         Remove `hostmask` from list of ignored hostmasks on `channel`.
392 NOTE: There is also a global ignore list, available for admins.
394 ==== Listing channel nicks ====
396 `channel nicks [channel]`
398 ==== Topic operations ====
400 Related plugins: [green]#Topic#.
402 Supybot allows elaborate manipulation of the channel topic.
404 http://supybot.com/documentation/plugins/topic
406 ==== Logging ====
408 Logging of channels is provided by the [green]#ChannelLogger# plugin. Various channel-specific configuration items are provided, see `config list plugins.ChannelLogger`.
410 By default logs will go into logs/ChannelLogger/<network>/<channel>/<channel>.log and will be rotated when the default "%d-%a-%Y" (eg. 06-Sat-2008) timestamp rotates. See http://docs.python.org/lib/module-time.html[the python documentation for strftime] for the formatting characters.
412 NOTE: The logs of [green]#ChannelLogger# cannot be searched online. However, other plugins provide some searching functionality. See <<searching-history,Searching the history>>.
414 ==== Auto-ops and voices ====
416 Auto-opping is provided by the [green]#AutoMode# plugin.
418 `load AutoMode`::
419         Loads the [green]#AutoMode# plugin, which works out-of-box. By default it's enabled on all channels and voices/halfops/ops users with respective capabilities. You can enable auto-opping only on some channels by tweaking the config keys below.
421 .plugins.AutoMode
422 [frame="topbot"]
423 `15`15`70~~~
424 Key,Default,Description
426 #enable,True,Whether the plugin is enabled.
427 #fallthrough,False,"If enabled and `op` is False, halfops/voices instead if they are True."
428 #halfop,True,Halfop users with the `halfop` capability.
429 #op,True,"Ditto, but op."
430 #voice,True,"Ditto, but voice."
431 #ban,True,Whether to ban people who join the channel and are on the banlist.
432 #ban.period,86400,How many seconds bans will last.
433 ~~~~
435 [[channel-capabilities]]
436 ==== Manipulating channel capabilities ====
438 `capability list [channel]`::
439         List capabilities on `channel`.
441 `capability set [channel] <capability..>`::
442         Adds the given `capability` to `channel`.
444 `capability unset [channel] <capability..>`::
445         Removes the given `capability` from `channel`.
447 `capability setdefault [channel] <True|False>`::
448         Whether to allow users on `channel` by default to access non-maintenance related commands. Default is True.
449         +
450         Note that this concerns unregistered users as well. So if you want to disallow use of commands by unregistered users, set default user capabilities to allow them, and set this to False.
452 See also <<capabilities,Capabilities>>.
454 === Users ===
456 Related plugins: [green]#Users#.
458 Supybot users are global: they are visible across networks. This means the same username/password and hostmasks will work in all networks the bot is on.
460 Users are recognized either by matching hostmasks, or after manually identifying to the bot. In secure mode, the user must both match a hostmask and identify to the bot (`uset set secure [password] <True|False>`).
462 NOTE: If users knowing each others' nicks is an issue, they could come up with different aliases when registering to the bot. The bot username does not have to match the nick of the user.
464 ==== Adding a new user ====
466 `user register <name> <password>`
468 ==== Manipulating hostmasks ====
470 `user hostmask add` - add your current hostmask. Obviously this makes only sense after identify.
472 `user hostmask add [name] [hostmask] [password]` - add hostmask for another user. If not owner, password must be given.
474 `user hostmask remove <name> <hostmask> [password]`
476 NOTE: There is no way to add network-specific hostmasks.
478 ==== Listing users ====
480 `user list [glob]` - list registered users. Note that the list of users is global across networks.
482 ==== Deleting users ====
484 `user unregister <name> [password]`
486 ==== Changing password ====
488 `user set password <user> <old password> <new password>`.
490 ==== Renaming a user ====
492 `user changename <name> <new name> [password]`
494 Users can change their name themselves.
496 [[user-capabilities]]
497 ==== Manipulating user capabilities ====
499 `capabilities [user]`::
500         List capabilities of the `user`, or the calling user.
502 `admin capability add <user|hostmask> <capability>`::
503         Add `capability` to `user` or a user that matches the `hostmask`.
505 `admin capability remove <user|hostmask> <capability>`::
506         Ditto, but remove the capability.
508 `channel capability add [channel] <nick|user> <capability..>`::
509         Add capability `capability` on `channel` to `nick`/`user`.
511 `channel capability remove [channel] <nick|user> <capability..>`::
512         Remove capability `capability` on `channel` from `nick`/`user`.
514 `defaultcapability <add|remove> <capability>`::
515         Add or remove `capability` from list of capabilities given to new users.
517 `config capabilities`::
518         List default capabilities given to new users.
520 .output
521 ----
522 -owner -admin -trusted
523 ----
525 See also <<capabilities,Capabilities>>.
527 === General bot maintenance ===
529 Related plugins: [green]#Admin, Config#.
531 ==== Setting nickname & alternative nick ====
533 `admin nick <newnick>`::
534         Change nick to `newnick`.
536 `config nick`::
537         Default nick.
539 `config nick.alternates`::
540         Space-separated list of alternate nicks, %s refers to nick.
542 NOTE: It is not possible to have a different nick in different networks.
544 ==== Setting ident ====
546 `config ident <newident>`::
547         Sets the bot's ident (`nick!ident@host`).
549 ==== Setting ircname ====
551 `config user [ircname]`::
552         Sets the bot's ircname/realname to `ircname`. If left empty, defaults to 'Supybot 0.83.3' for example.
554 ==== Setting command prefix / controlling when the bot replies ====
556 Like most other bots, the bot can be addressed by its nickname, or a command prefix character (any or many of `~!@#$%^&*()_-+=[{}]\|'";:,<.>/?`). For special (braindead?) purposes the bot can also be made assume that all lines are addressed to it.
558 `config reply.whenAddressedBy.chars`::
559         List of characters the bot will recognize as addressing, besides the nick of the bot.
561 `config channel [channel] reply.whenAddressedBy.chars`::
562         Ditto, but for a specific channel.
564 `config reply.whenNotAddressed`::
565         Assume everyone wants to talk to the bot, eg. treat all messages as if addressed to the bot. This does not imply `reply.WhenNotCommand False` which you should set as well.
567 `config reply.whenNotCommand`::
568         Whether to reply when addressed with an invalid command.
570 See also: <<config_reply,Configuration: reply>>.
572 ==== Keeping the primary nick ====
574 Like other bots, Supybot can be configured to try and keep the primary nick using the [green]#NickCapture# plugin. This is primarily useful in networks with no NickServ support.
576 `load NickCapture`::
577         Loads the plugin which works without further configuration.
579 `config plugins.NickCapture.ison`::
580         Whether the plugin is actively checking for the primary nick. This setting makes no sense, as you might as well `unload NickCapture` if you think about setting this to false.
582 `config plugins.NickCapture.ison.period`::
583         How many seconds to wait between nick availibity polls. The default is 600 (10 min). The smaller you set this, the higher the chance of the bot recovering the nick when it becomes available. On the other hand, you will also generate more traffic so you might want to avoid that.
585 === Owner commands ===
587 `owner announce <text>` - send `text` to all channels the bot is on.
589 `owner ircquote <raw>` - send `raw` as-is to the server. You need to know your way around http://www.faqs.org/rfcs/rfc1459.html[RFC1459] pretty well to use this.
591 == User commands ==
593 [[searching-history]]
594 === Searching the history ===
596 `url last [channel] [\--{from,with,without,near,proto} value] [\--nolimit]`::
597         Find last URL (or all with `\--nolimit`) matching given criteria. From matches nick, with(out) part of the URL, near rest of the line where the URL was, and proto matches the protocol (https, ftp, etc). In case of multiple URLs, the newest is listed first. Multiple criterias can be given.
599         NOTE: This command lists only the URLs, not nick or what message the URLs were part of. No date is shown either.
601 `last [\--from,in,on,with,without,regexp} value] [\--nolimit]`::
602         Find messages matching given criteria. From matches nick, in matches channel, on matches network, with(out) matches part of the message, regexp matches messages that are included by the regular expression. Also see `config protocols.irc.maxHistoryLength`.
604 === Useful plugins ===
606 [[plugin_anonymous]]
607 ==== Anonymous ====
609 Allows you to provide users a way to chat on a channel anonymously (eg. only the bot owner(s) know via logs who are talking).
611 `do <channel> <action>`::
612         Sends `action` to `channel`. This is the same as a normal IRC client `/me does something` command.
614 `say <channel> <text>`::
615         Say `text` on `channel`.
617 .plugins.Anonymous
618 `15`15`70~~~
619 Key,Default,Description
621 #requirePresenceInChannel,True,Whether the user must be in the channel the message is targeted to.
622 allowPrivateTarget,False,Whether to allow a nick as a target for say. NOTE: This has not been implemented in 0.83.3 although it exists!
623 requireCapability,,"If set, capability to check for."
624 requireRegistration,True,Whether registration is required to use this plugin.
627 [[plugin_dict]]
628 ==== Dict ====
630 [green]#Dict# provides dictionary functionality using dict.org. You can also use a local dictd server.
632 `dict [dictionary] <word>`::
633         Show dictionary entry for `word`, from `dictionary` if provided. If `plugins.Dict.default` is set, use the specified dictionary instead of all.
635 `dictionaries`::
636         List dictionaries available on the used server.
638 `dict random`::
639         Show a random dictionary from available dictionaries.
641 `config plugins.Dict.server [server]`::
642         The dictd server to be used, default is dict.org.
644 `config plugins.Dict.default [dictionary]`::
645         Channel-specific default dictionary for `dict` command. `*` means to use all dictionaries. `wn` is a good default if english words are mostly looked up.
647 [[plugin_later]]
648 ==== Later ====
650 This is a nick-based replacement for NoteServ and the likes. Simply put, you give the bot a note to deliver to a nick (or wildcard) the next time it sees a matching nick. In other words, this can be used to deliver messages to people who are not registered to the bot. Naturally that is not a very safe method of communicating.
652 `notes [nick]`::
653         List nicks that have notes queued, or the notes queued for `nick` if given.
655 `later tell <nick> <text>`::
656         Queues `text` to be sent to first matching `nick` when seen. Nick can contain wildcards, eg. `foo*`.
658 `config plugins.Later.maximum`::
659         How many messages can be queued per nick at maximum, default is 0 = no limit.
661 `config plugins.Later.private`::
662         Whether to send notes in private or on the channel where the recipient is seen.
664 [[plugin_seen]]
665 ==== Seen ====
667 The [green]#Seen# plugin keeps track of last channel/nick/user activity. Most typical use is asking the bot when a given user was last seen chatting on a channel.
669 `seen any [channel] [\--user <user>] [nick]`::
670         Lists any activity given `nick` or `user` was doing on the channel. If no `nick` or `user` is given, returns the last activity on the channel, regardless of who it was from.
672 `seen last [channel]`::
673         Last line said on the channel.
675 `seen [channel] <nick>`::
676         Last time a `nick` was seen on a channel and what it said.
678 `seen user [channel] <user>`:
679         Ditto, except use a user name, disregarding what nick the said user had.
681 [[plugin_web]]
682 ==== Web ====
684 The [green]#Web# plugin contains some useful WWW-related functionality, such as fetching titles for URLs users paste on the channel.
686 `doctype <url>`::
687         Show the doctype line of `url`, if any.
689 `fetch <url>`::
690         Show the contents of `url`. Amount of data shown is determined by the configuration variable `plugins.Web.fetch.maximum`.
692 `headers <url>`::
693         Show web server headers for the `url`.
695 `netcraft <hostname|ip>`::
696         Ask netcraft what OS and web server it thinks the server is running.
698 `size <url>`::
699         Show size of `url`, based on the `Content-Length` header sent by the web server.
701 `title <url>`::
702         Show title for `url`. This can be done automatically for all URLs pasted on a channel; see the configuration variable `plugins.Web.titleSnarfer`.
704 `urlquote <text>`::
705         Return `text` quoted into a URL. Eg. `urlquote foo bar` -> `foo%20bar`.
707 `urlunquote <text>`::
708         Likewise, but reverse.
710 .plugins.Web
711 [frame="topbot"]
712 `15`15`70~~~
713 Key,Default,Description
714 ~~~~
715 #nonSnarfingRegexp,,"if set, URLs matching the pattern are not snarfed."
716 #titleSnarfer,false,Whether to fetch and show the title for pasted URLs.
717 fetch.maximum,0,"Maximum bytes to fetch with the `fetch` command. If zero, `fetch` is disabled."
718 ~~~~
720 === Entertainment ===
722 [[plugin_channelstats]]
723 ==== ChannelStats ====
725 [green]#ChannelStats# provides channel/registered user statistics (statistics as in 'large numbers').
727 `channelstats [channel]`:
728         Show statistics for `channel`: messages, characters, words, smileys, frowns, actions, joins, parts, quits, kicks, mode changes, and topic changes.
730 `stats [channel] [user]`:
731         Show statistics for `user` on `channel`: messages, characters, words, smileys, frowns, actions, joins, parts, quits, kicks given/received, topic changes, and mode changes.
733 WARNING: This plugin may turn otherwise normal users into spammers. But it can also provide an incentive to register on the bot. :-)
735 .plugins.ChannelStats
736 [frame="topbot"]
737 `15`15`70~~~
738 Key,Default,Description
740 #frowns,`:| :-/ :-\ :\ :/ :( :-( :'(`,Space-separated list of frowns.
741 #selfStats,`True`,Whether to include the bot in the statistics.
742 #smileys,`:) ;) ;] :-) :-D :D :P :p (= =)`,Space-separated list of smileys.
743 ~~~~
745 [[plugin_games]]
746 ==== Games ====
748 `coin`::
749         Heads or tails?
751 `dice <dices>d<sides>`::
752         Roll `dices` dices, each having `sides` sides. Lists result for each dice separately. The sum will be between `dices` and `dices` x `sides`.
754 `eightball [question]`::
755         Answers a question. But don't expect the bot to pass 
757 `monologue [channel]`::
758         Check how long your monologue on the `channel` is, in case you are lose count. This is probably my favourite useless command.
760 `roulette ["spin"]`::
761         Russian roulette. If `spin` is given, spins the chambers. This isn't really necessary since it will be done automatically at the end of the round. Provides a different experience if the bot is opped.
763 [[plugin_nickometer]]
764 ==== Nickometer ====
766 `nickometer [nick]`:
767         Give an objective evaluation on the lameness of `nick`, or your nick if not provided. This is similar to the same command in blootbot.
769 .output
770 ----
771 The "lame nick-o-meter" reading for "1eEteStWaReZL0rD[69X~" is 99.98%.
772 ----
774 [[plugin_quote]]
775 ==== Quote ====
777 `quote add [channel] <text>`::
778         Add `text` as a quote for `channel`.
780 `quote change [channel] <id> <regexp>`::
781         Change quote `id` on `channel` using `regexp`. For example, `s/foo/bar/g` changes all instances of `foo` to `bar`.
783 `quote get [channel] <id>`::
784         Show quote # `id` for `channel`.
786 `quote random [channel]`::
787         Show random quote from `channel`.
789 `quote remove [channel] <id>`::
790         Remove quote # `id` from `channel`.
792 `quote search [channel] [\--{regexp,by} value] [glob]`::
793         Find quotes from `channel` matching regexp if provided, added by nick `by` if provided, and matching `glob` if provided. `glob` may contain wildcards (eg. `foo*bar`), while `regexp` is a regular expression (eg. `/la.*laa/`). Note that you can really provide both regexp and the glob - both must match in that case.
795 `quote stats [channel]`::
796         Show how many quotes there are.
798 [[plugin_quotegrabs]]
799 ==== QuoteGrabs ====
801 This plugin allows users to 'grab' the most recent line of another nick as a quote.
803 `quotegrabs get [channel] <id>`::
804         Show quote # `id` .
806 `quotegrabs grab [channel] <nick>`::
807         Save last line from `nick` as a quote.
809 `quotegrabs list [channel] <nick>`::
810         List quotes for `nick`, newest first. This does not display full quotes, but part of each, along with the id.
812 `quotegrabs quote [channel] <nick>`::
813         Show last quote of `nick`.
815 `quotegrabs random [channel] [nick]`::
816         Random quote from any nick, or `nick` if provided.
818 `quotegrabs search [channel] <text>`::
819         Show quotes containing `text`. Unfortunately, this does not list the nick or allow searching only given nick's quotes. Id and quote content will be shown.
821 .plugins.QuoteGrabs
822 [frame="topbot"]
823 `15`15`70~~~
824 Key,Default,Description
826 #randomGrabber,False,Whether to grab random lines as quotes.
827 #randomGrabber.averageTimeBetweenGrabs,864000,Average number of seconds to wait between random grabs. When half of this has passed a random grab may occur.
828 randomGrabber.minimumCharacters,8,Minimum characters needed to consider a line eligible for random grab.
829 randomGrabber.minimumWords,3,"Ditto, but for words."
830 ~~~~
832 == Caveats ==
834 This is a list of issues I have not yet figured out how to do, or there simply isn't a way.
836 - How to enforce channel modes (eg. force +ns-t for example)
837 - How to delete config items
838 - How to delete channels / networks
839 - Ban add does not seem to work on Freenode
840 - No global ban list
841 - No way to delete a network
842 - Incomplete multi-network support
843         * Capabilities are not network/channel -specific, but channel-specific. If channel by same name exists in two networks, the users have same capabilities on both
844         * No way to add network-specific hostmasks
845         * Not possible for the bot to have different nick in different networks
846 - There is no command to reboot the bot; it must be done from the shell
847 - Capabilities/anticapabilities for commands with spaces in them are not supported
849 == Tips ==
851 === How to emulate blootbot CMDs using MoobotFactoids ===
853 [,yellow]#Thanks to Tobias "beardy" Rosenqvist for the tip!#
855 We try to make a command factoid, like we are used to with blootbot:
857 ----
858 <user> cmdtest is <action> gives $1 "(an apple|a pear)"
859 <bot> Ok.
860 ----
862 Then we test it:
864 ----
865 <user> cmdtest someone
866 ----
868 But it doesn't work.
869 However, the factoid works:
871 ----
872 <user> cmdtest
873   * bot gives $1 an apple
874 ----
876 The Moobotfactoids plugin in supybot doesn't handle arguments, (yet)
877 unfortunately, so you need to do it another way.
878 Use the Moobotfactoids to do the random part(s):
880 ----
881 <user> fruits is <reply> "(an apple|an orange|a banana|a pear)"
882 <bot> Ok.
883 ----
885 Then use an alias to do the command, with arguments (the "action" command
886 is found in the Reply plugin), here you also see a use of a nested command:
888 ----
889 <user> alias add givefruit action gives "[fruits]" to $1
890 <bot> Ok.
891 <user> givefruit someone
892  * bot gives a pear to someone
893 ----
895 === Tidier bot replies ===
897 I don't personally like the default Supybot replies: I hate the nick prefix and the way too verbose 'The operation succeeded.'.
899 Fortunately there are plenty of settings to configure how Supybot replies. These can be listed with `config reply` and `config replies`.
901 The `reply` items determine how Supybot acts, and `replies` contains some messages it uses. I prefer:
903 `config reply.withNickPrefix False`
905 `config replies.success OK`
907 `config reply.error.inPrivate True`.
909 === More on nested commands ===
911 [,yellow]#Thanks to Tobias "beardy" Rosenqvist for the tip!#
913 For those familliar with unix shells, (bash in particular), nested commands can be compared to doing command substitution, as in `$(command)`.
915 Nested commands are by default enclosed by square brackets (`[]`). The `commands.nested.brackets` configuration variable can be used to set these to `<>`, `{}`, or `()`.
917 ----
918 <user> echo The title of the Supybot website is: [web title http://www.supybot.com/]
919 <bot> The title of the Supybot website is: Welcome to Supybot.com! Supybot Website
920 ----
922 Another way nested commands can work, is like a pipe, if the configuration variable `commands.nested.pipeSyntax` is set to `True`.
924 Same example as above, but using the pipeSyntax:
926 ----
927 <user> web title http://www.supybot.com/ | echo The title of the Supybot website is:
928 <bot> The title of the Supybot website is: Welcome to Supybot.com! Supybot Website
929 ----
931 == Reference ==
933 === Configuration ===
935 [[config_reply]]
936 ==== reply ====
938 *#inPrivate*:: Whether to reply in private to commands given on channel.
940 *#requireChannelCommandsToBeSentInChannel*:: -
942 *#showSimpleSyntax*:: Whether to be extra helpful when a user fails syntax of a command.
944 *#whenNotAddressed*:: Assume everyone wants to talk to the bot, eg. treat all messages as if addressed to the bot. This does not imply `reply.WhenNotCommand False` which you should set as well.
946 *#whenNotCommand*:: Whether to reply when addressed with an invalid command.
948 *#withNickPrefix*:: Whether to prefix the reply with the nick of the user who gave the command.
950 *#withNotice*:: Whether to use notices instead of regular messages.
952 *#mores.instant*:: How many messages to send initially before prompting for `more`. Default is 1.
954 *#mores.length*:: How long messages can be. Default is 0, which uses rocket science to determine the maximum number of characters that can be fit into a message without it collapsing into a black hole.
956 *#mores.maximum*:: Maximum number of messages to queue, default is 50.
958 *#error.inPrivate*:: Whether to send errors in private instead of replying on channel.
960 *#error.noCapability*:: If True, don't tell users why they can not run a command because of missing capabilities.
962 *#error.withNotice*:: Whether to send errors as notices instead of regular messages.
964 *error.detailed*:: Whether to show an exception or a generic error when something breaks. Mostly useful for developers.
966 *#format.time*:: Format string for timestamps (`%I:%M %p, %B %d, %Y`, eg. '08:41 PM, September 11, 2008').
968 *#whenAddressedBy.chars*:: List of characters the bot will recognize as addressing (when a command is prefixed with one of them), besides the nick of the bot.
970 *#whenAddressedBy.nicks*:: List of extra nicks to consider as addressing the bot, despite the current nick.
972 *#whenAddressedBy.strings*:: Like the chars key, except a space-separated list of strings to accept as command prefix. This allows multicharacter command prefixes.
974 *#whenAddressedBy.nick.atEnd*:: Whether to consider messages that end in the bot's nick to be addressed to the bot.
976 *maximumLength*:: Maximum length of a reply message from the bot. This does not mean the length of a single message (prompting for `more`), but the whole message.
978 *oneToOne*:: Whether to send replies consisting of multiple messages in a single message.
980 *withNoticeWhenPrivate*:: Whether to use notices instead of private messages.
982 === Directory tree ===
984 This section contains list of the directories and files supybot uses, and what they are for.
986 NOTE: If you modify the configuration files by hand when the bot is running, you need to run `config reload`.
988 `backup/`::
989         For backups of config files.
991 `conf/`::
992         Configuration files: {channels,ignores,userdata,users}.conf
994 `data/`::
995         Plugin databases.
997 `data/#channel/`::
998         Channel-specific plugin databases.
1000 `data/tmp/`::
1001         Temporary plugin data files (eg. database journals).
1003 `logs/`::
1004         Logs.
1006 `logs/ChannelLogger/`::
1007         ChannelLogger logs. The structure depends on the config variables.
1009 `logs/messages.log`::
1010         The main logfile.
1012 `plugins/`::
1013         Local plugin directory. This is by default listed in `config directories.plugins`.
1015 `<bot>.conf`::
1016         The main configuration file of the bot.
1018 `tmp/`::
1019         Temporary files.