Games plugin.
[supybook.git] / index.txt
blob26195f9c364cd82a67464a680668218455fb9709
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 and connected to a network.
53 === Identifying to the bot ===
55 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.
57 === Accessing the online help ===
59 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.
61 Help for configuration items can be accessed with the `config help <key>` command.
63 == Understanding supybot's peculiarities ==
65 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.
67 === Nested commands ===
69 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:
71 `config reply.withNickPrefix [config default reply.withNickPrefix]`
73 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 ;-)
75 === Plugins ===
77 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:
79 .output
80 ----
81 Error: The command "ignore list" is available in the Admin and Channel plugins.
82 Please specify the plugin whose command you wish to call by using its name as a command before "ignore list".
83 ----
85 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.
87 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:
89 `config plugins.<plugin>.public False`
91 `list`::
92         List currently loaded plugins, excluding the ones set non-public.
94 `list \--private`::
95         List loaded plugins that are set to non-public.
97 `list <plugin>`::
98         List commands provided by the given plugin.
100 `load [\--deprecated] <plugin>`::
101         Load a plugin. Supybot looks for plugins in directories listed in `config conf.supybot.directories.plugins`.
103 `unload <plugin>`::
104         Unloads a plugin. The [green]#Owner# plugin cannot be unloaded.
106 === Configuration ===
108 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).
110 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.
112 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`.
114 `config <name> [value]`::
115         Get the current value of `name`, or set it to `value` if provided.
117 `config channel [channel] <name> [value]`::
118         Ditto, but for channel configs.
120 `config default <name>`::
121         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.
123 `config export <filename>`::
124         Export non-confidential parts of configuration to a file for debugging purposes.
126 `config help <name>`::
127         Show help for a configuration item.
129 `config list <group>`::
130         List configuration items in `group`. Subgroups are prefixed with '@', channel-specific items with '#'.
132 `config reload`::
133         Reloads configuration. Mostly useful if you've had to modify the files by hand.
135 `config search <word>`::
136         Show configuration items matching `word`.
138 [[capabilities]]
139 === Capabilities ===
141 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.
143 Supybot does not have any flags. Instead, the permissions are managed using 'capabilities'. There are two kinds of capabilities: `user capabilities` and `channel capabilities`.
145 '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.
147 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`.
149 There are some special capabilities recognized by Supybot:
151 `owner`::
152         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.
154 `admin`::
155         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.
157 `#channel,op`::
158         Channel ops can execute channel-related commands.
160 `trusted`::
161         Allow user to run commands that can potentially crash the bot, or cause denial of service on the system it's running on.
163 Commands used to manipulate capabilities are covered in the <<channel-capabilities,Manipulating channel capabilities>> and <<user-capabilities,Manipulating user capabilities>> sections.
165 == Administrative tasks ==
167 === Networks ===
169 Related plugins: [green]#Network, Services#.
171 ==== Adding a network ====
173 `network connect [--ssl] <network> [<host[:port]>] [password]`::
174         Connect to `network`. `host` must be provided if the network is new or has no servers defined.
176 ==== Reconnecting ====
178 `reconnect [network] [message]`::
179         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.
181 ==== Disconnecting ====
183 `network disconnect [network] [message]`::
184         Disconnect `network`, or current if not specified. `message` as above.
186 ==== Listing networks ====
188 `networks`::
189         List of networks & servers currently connected to.
191 .output
192 ----
193 freenode: wolfe.freenode.net and ircnet: irc.elisa.fi
194 ----
196 `config list networks`::
197         List all networks.
199 ==== Adding more servers ====
201 Once you've added a network with the initial server, you can add more servers:
203 `config networks.<network>.servers [config networks.<network>.servers] server:6667`
205 ==== Listing network servers ====
207 `config networks.<network>.servers`
209 .output
210 ----
211 chat.freenode.net:6667
212 ----
214 ==== Services: NickServ ====
216 WARNING: My pratical experience with [green]#Services# plugin on Freenode is... not-so-good. It definitely does not work all the time as expected.
218 You can make Supybot identify itself to the network NickServ after it has connected.
220 `config plugins.Services.noJoinsUntilIdentified True`::
221         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.
223 `config plugins.Services.NickServ NickServ`::
224         Tell the bot what name NickServ can be found under.
226 `services password <nick> [password]`::
227         Can be used to set or remove NickServ password.
229         NOTE: Password removal did not work for me on Supybot 0.83.3
230         
231 `services identify`::
232         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.
234 ==== Services: ChanServ ====
236 You can make Supybot request op after joining a channel on a network with ChanServ.
238 `config plugins.Services.ChanServ ChanServ`::
239         Tell the bot what name ChanServ can be found under.
241 `config plugins.Services.ChanServ.op <on|off>`::
242         Set the default for all channels. This will be used unless a channel-specific config overrides it.
244 `config channel [channel] plugins.services.ChanServ.op <on|off>`::
245         Set to request op on the given `channel`.
247 Voice and half-op (on networks supporting it) can be used similarly.
249 === Channels ===
251 Related plugins: [green]#Channel#.
253 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.
255 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.
257 ==== Adding a new channel ====
259 A new channel is added by messaging the bot in the same network with `join <channel> [key]` command.
261 ==== Listing channels ====
263 `channels`
265 NOTE: This only works in private, to prevent knowledge of top secret channels from falling into wrong hands.
267 You can list channels in another network with `config networks.<network>.channels`.
269 ==== Removing a channel ====
271 `part [channel] [reason]`
273 ==== Modifying channel config ====
275 `config channel [channel] <name> <value>`
277 ==== Setting the key ====
279 `channel key [channel] [key]` can be used to set or clear the channel key.
281 ==== Setting the limit ====
283 `channel limit [channel] [limit]` sets or clears the channel limit.
285 ==== Channel commands ====
287 Channel ops can use the following commands to control the channel via the bot, assuming it is opped.
289 `op [channel] [nick...]`::
290         Ops the given nicks (or you if none) on the channel.
292 `deop [channel] [nick...]`::
293         Ditto, but deops.
295 `voice [channel] [nick...]`::
296         Voices the given nicks (or you if none) on the channel.
298 `devoice [channel] [nick...]`::
299         Ditto, but devoices.
301 `kban [channel] [\--{exact,nick,user,host}] <nick> [seconds] [reason]`::
302         Bans and kicks the given nick from the channel. If `seconds` is specified and is not 0, the ban will expire after that time.
304 `mode [channel] <mode> [params]`::
305         Set channel mode. This can be used to change any channel modes, making the commands below redundant aliases.
307 `moderate [channel]`::
308         Set +m. This is not enforced by the bot, so any channel op can remove it.
310 `unmoderate [channel]`::
311         Set -m.
313 `topic lock [channel]`::
314         Set +t. Not enforced, so any channel op can remove it.
316 `topic unlock [channel]`::
317         Set -t.
319 `alert [channel] <text>`::
320         Sends `text` to all users on the channel with op capability.
322 `cycle [channel]`::
323         Make the bot part and join the channel. Mostly useful to test whether auto-ops from other bots/users work for the bot.
325 ==== Maintaining the ban list ====
327 `ban add [channel] <nick|hostmask> [expires]`::
328         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.
330 `ban list [channel]`::
331         List bans with their expire times.
333 `ban remove [channel] <hostmask>`::
334         Removes the ban on given `hostmask`.
336 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.
338 ==== Maintaining the ignore list ====
340 `channel ignore add [channel] <nick|hostmask> [expires]`
342 `channel ignore list [channel]`
344 `channel ignore remove [channel] <hostmask>`
346 NOTE: There is also a global ignore list.
348 ==== Listing channel nicks ====
350 `channel nicks [channel]`
352 ==== Topic operations ====
354 Related plugins: [green]#Topic#.
356 Supybot allows elaborate manipulation of the channel topic.
358 http://supybot.com/documentation/plugins/topic
360 ==== Logging ====
362 Logging of channels is provided by the [green]#ChannelLogger# plugin. Various channel-specific configuration items are provided, see `config list plugins.ChannelLogger`.
364 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.
366 NOTE: The logs of [green]#ChannelLogger# cannot be searched online. However, other plugins provide some searching functionality. See <<searching-history,Searching the history>>.
368 ==== Auto-ops & voices ====
370 Auto-opping is provided by the [green]#AutoMode# plugin.
372 ==== Seen ====
374 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.
376 `seen any [channel] [\--user <user>] [nick]`::
377         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.
379 `seen last [channel]`:
380         Last line said on the channel.
382 `seen [channel] <nick>`::
383         Last time a `nick` was seen on a channel and what it said.
385 `seen user [channel] <user>`:
386         Ditto, except use a user name, disregarding what nick the said user had.
388 [[channel-capabilities]]
389 ==== Manipulating channel capabilities ====
391 `capability list [channel]`::
392         List capabilities on `channel`.
394 `capability set [channel] <capability..>`::
395         Adds the given `capability` to `channel`.
397 `capability unset [channel] <capability..>`::
398         Removes the given `capability` from `channel`.
400 `capability setdefault [channel] <True|False>`::
401         Whether to allow users on `channel` by default to access non-maintenance related commands. Default is True.
402         +
403         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.
405 See also <<capabilities,Capabilities>>.
407 === Users ===
409 Related plugins: [green]#Users#.
411 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.
413 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>`).
415 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.
417 ==== Adding a new user ====
419 `user register <name> <password>`
421 ==== Manipulating hostmasks ====
423 `user hostmask add` - add your current hostmask. Obviously this makes only sense after identify.
425 `user hostmask add [name] [hostmask] [password]` - add hostmask for another user. If not owner, password must be given.
427 `user hostmask remove <name> <hostmask> [password]`
429 NOTE: There is no way to add network-specific hostmasks.
431 ==== Listing users ====
433 `user list [glob]` - list registered users. Note that the list of users is global across networks.
435 ==== Deleting users ====
437 `user unregister <name> [password]`
439 ==== Changing password ====
441 `user set password <user> <old password> <new password>`.
443 ==== Renaming a user ====
445 `user changename <name> <new name> [password]`
447 Users can change their name themselves.
449 [[user-capabilities]]
450 ==== Manipulating user capabilities ====
452 `capabilities [user]`::
453         List capabilities of the `user`, or the calling user.
455 `admin capability add <user|hostmask> <capability>`::
456         Add `capability` to `user` or a user that matches the `hostmask`.
458 `admin capability remove <user|hostmask> <capability>`::
459         Ditto, but remove the capability.
461 `channel capability add [channel] <nick|user> <capability..>`::
462         Add capability `capability` on `channel` to `nick`/`user`.
464 `channel capability remove [channel] <nick|user> <capability..>`::
465         Remove capability `capability` on `channel` from `nick`/`user`.
467 `defaultcapability <add|remove> <capability>`::
468         Add or remove `capability` from list of capabilities given to new users.
470 `config capabilities`::
471         List default capabilities given to new users.
473 .output
474 ----
475 -owner -admin -trusted
476 ----
478 See also <<capabilities,Capabilities>>.
480 === General bot maintenance ===
482 Related plugins: [green]#Admin, Config#.
484 ==== Setting nickname & alternative nick ====
486 `admin nick <newnick>`::
487         Change nick to `newnick`.
489 `config nick`::
490         Default nick.
492 `config nick.alternates`::
493         Space-separated list of alternate nicks, %s refers to nick.
495 NOTE: It is not possible to have a different nick in different networks.
497 ==== Setting ident ====
499 `config ident <newident>`::
500         Sets the bot's ident (`nick!ident@host`).
502 ==== Setting ircname ====
504 `config user [ircname]`::
505         Sets the bot's ircname/realname to `ircname`. If left empty, defaults to 'Supybot 0.83.3' for example.
507 ==== Setting command prefix / controlling when the bot replies ====
509 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.
511 `config reply.whenAddressedBy.chars`::
512         List of characters the bot will recognize as addressing, besides the nick of the bot.
514 `config channel [channel] reply.whenAddressedBy.chars`::
515         Ditto, but for a specific channel.
517 `config reply.whenNotAddressed`::
518         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.
520 `config reply.whenNotCommand`::
521         Whether to reply when addressed with an invalid command.
523 ==== Listing and searching settings ====
525 `config search <word>` - list config items containing word.
527 `config <name>` - show config value for name.
529 `config <name> <value>` - set config value for name.
531 === Owner commands ===
533 `owner announce <text>` - send `text` to all channels the bot is on.
535 `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.
537 == User commands ==
539 [[searching-history]]
540 === Searching the history ===
542 `url last [channel] [\--{from,with,without,near,proto} value] [\--nolimit]`::
543         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.
545         NOTE: This command lists only the URLs, not nick or what message the URLs were part of. No date is shown either.
547 `last [\--from,in,on,with,without,regexp} value] [\--nolimit]`::
548         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`.
550 === Useful plugins ===
552 ==== ChannelStats ====
554 [green]#ChannelStats# provides channel/registered user statistics (statistics as in 'large numbers').
556 `channelstats [channel]`:
557         Show statistics for `channel`: messages, characters, words, smileys, frowns, actions, joins, parts, quits, kicks, mode changes, and topic changes.
559 `stats [channel] [user]`:
560         Show statistics for `user` on `channel`: messages, characters, words, smileys, frowns, actions, joins, parts, quits, kicks given/received, topic changes, and mode changes.
562 WARNING: This plugin may turn otherwise normal users into spammers. But it can also provide an incentive to register on the bot. :-)
564 .plugins.ChannelStats
565 [frame="topbot"]
566 `15`15`70~~~
567 Key,Default,Description
569 #frowns,`:| :-/ :-\ :\ :/ :( :-( :'(`,Space-separated list of frowns.
570 #selfStats,`True`,Whether to include the bot in the statistics.
571 #smileys,`:) ;) ;] :-) :-D :D :P :p (= =)`,Space-separated list of smileys.
572 ~~~~
574 ==== Dict ====
576 [green]#Dict# provides dictionary functionality using dict.org. You can also use a local dictd server.
578 `dict [dictionary] <word>`::
579         Show dictionary entry for `word`, from `dictionary` if provided. If `plugins.Dict.default` is set, use the specified dictionary instead of all.
581 `dictionaries`::
582         List dictionaries available on the used server.
584 `dict random`::
585         Show a random dictionary from available dictionaries.
587 `config plugins.Dict.server [server]`::
588         The dictd server to be used, default is dict.org.
590 `config plugins.Dict.default [dictionary]`::
591         Channel-specific default dictionary for `dict` command. `*` means to use all dictionaries. `wn` is a good default if english words are mostly looked up.
593 ==== Later ====
595 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.
597 `notes [nick]`::
598         List nicks that have notes queued, or the notes queued for `nick` if given.
600 `later tell <nick> <text>`::
601         Queues `text` to be sent to first matching `nick` when seen. Nick can contain wildcards, eg. `foo*`.
603 `config plugins.Later.maximum`::
604         How many messages can be queued per nick at maximum, default is 0 = no limit.
606 `config plugins.Later.private`::
607         Whether to send notes in private or on the channel where the recipient is seen.
609 === Toys ===
611 ==== Games ====
613 `coin`::
614         Heads or tails?
616 `dice <dices>d<sides>`::
617         Roll `dices` dices, each having `sides` sides. Lists result for each dice separately. The sum will be between `dices` and `dices` x `sides`.
619 `eightball [question]`::
620         Answers a question. But don't expect the bot to pass 
622 `monologue [channel]`::
623         Check how long your monologue on the `channel` is, in case you are lose count. This is probably my favourite useless command.
625 `roulette ["spin"]`::
626         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.
629 ==== Nickometer ====
631 ==== Quote ====
633 ==== QuoteGrabs ====
635 == Caveats ==
637 This is a list of issues I have not yet figured out how to do, or there simply isn't a way.
639 - How to enforce channel modes (eg. force +ns-t for example)
640 - How to delete config items
641 - How to delete channels / networks
642 - Ban add does not seem to work on Freenode
643 - No global ban list
644 - No way to delete a network
645 - Incomplete multi-network support
646         * 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
647         * No way to add network-specific hostmasks
648         * Not possible for the bot to have different nick in different networks
649 - There is no command to reboot the bot; it must be done from the shell
651 == Tips ==
653 === How to emulate blootbot CMDs using MoobotFactoids ===
655 [,yellow]#Thanks to Tobias Rosenqvist for the tip!#
657 We try to make a command factoid, like we are used to with blootbot:
659 ----
660 <user> cmdtest is <action> gives $1 "(an apple|a pear)"
661 <bot> Ok.
662 ----
664 Then we test it:
666 ----
667 <user> cmdtest someone
668 ----
670 But it doesn't work.
671 However, the factoid works:
673 ----
674 <user> cmdtest
675   * bot gives $1 an apple
676 ----
678 The Moobotfactoids plugin in supybot doesn't handle arguments, (yet)
679 unfortunately, so you need to do it another way.
680 Use the Moobotfactoids to do the random part(s):
682 ----
683 <user> fruits is <reply> "(an apple|an orange|a banana|a pear)"
684 <bot> Ok.
685 ----
687 Then use an alias to do the command, with arguments (the "action" command
688 is found in the Reply plugin), here you also see a use of a nested command:
690 ----
691 <user> alias add givefruit action gives [fruits] to $1
692 <bot> Ok.
693 <user> givefruit someone
694  * bot gives a pear to someone
695 ----
697 === Tidier bot replies ===
699 I don't personally like the default Supybot replies: I hate the nick prefix and the way too verbose 'The operation succeeded.'.
701 Fortunately there are plenty of settings to configure how Supybot replies. These can be listed with `config reply` and `config replies`.
703 The `reply` items determine how Supybot acts, and `replies` contains some messages it uses. I prefer:
705 `config reply.withNickPrefix False`
707 `config replies.success OK`
709 `config reply.error.inPrivate True`.
711 == Reference ==
713 === Configuration ===
715 ==== reply ====
717 *#inPrivate*:: Whether to reply in private to commands given on channel.
719 *#requireChannelCommandsToBeSentInChannel*:: -
721 *#showSimpleSyntax*:: Whether to be extra helpful when a user fails syntax of a command.
723 *#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.
725 *#whenNotCommand*:: Whether to reply when addressed with an invalid command.
727 *#withNickPrefix*:: Whether to prefix the reply with the nick of the user who gave the command.
729 *#withNotice*:: Whether to use notices instead of regular messages.
731 *#mores.instant*:: How many messages to send initially before prompting for `more`. Default is 1.
733 *#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.
735 *#mores.maximum*:: Maximum number of messages to queue, default is 50.
737 *#error.inPrivate*:: Whether to send errors in private instead of replying on channel.
739 *#error.noCapability*:: If True, don't tell users why they can not run a command because of missing capabilities.
741 *#error.withNotice*:: Whether to send errors as notices instead of regular messages.
743 *error.detailed*:: Whether to show an exception or a generic error when something breaks. Mostly useful for developers.
745 *#format.time*:: Format string for timestamps (`%I:%M %p, %B %d, %Y`, eg. '08:41 PM, September 11, 2008').
747 *#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.
749 *#whenAddressedBy.nicks*:: List of extra nicks to consider as addressing the bot, despite the current nick.
751 *#whenAddressedBy.strings*:: Like the chars key, except a space-separated list of strings to accept as command prefix. This allows multicharacter command prefixes.
753 *#whenAddressedBy.nick.atEnd*:: Whether to consider messages that end in the bot's nick to be addressed to the bot.
755 *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.
757 *oneToOne*:: Whether to send replies consisting of multiple messages in a single message.
759 *withNoticeWhenPrivate*:: Whether to use notices instead of private messages.