minor doc tweaks

This commit is contained in:
neersighted 2012-02-28 10:13:12 +08:00 committed by lukeroge
parent c58192f72c
commit 2364cb7bac
4 changed files with 12 additions and 8 deletions

View file

@ -12,7 +12,7 @@ Before you can run the bot, you need to install a few Python modules. These are
```sudo apt-get install python-beautifulsoup ```sudo apt-get install python-beautifulsoup
``` ```
For the spell.py plugin to work you need *python-enchant*. This can be installed with: For the spell.py plugin to work you need *Enchant*. This can be installed with:
```sudo apt-get install python-enchant ```sudo apt-get install python-enchant
``` ```

View file

@ -10,16 +10,16 @@ pyfibot http://code.google.com/p/pyfibot/
- interesting, but lots of magic - interesting, but lots of magic
rbot http://linuxbrit.co.uk/rbot/ rbot http://linuxbrit.co.uk/rbot/
- Ruby - ruby
- lots of plugins - lots of plugins
pyirc http://www.k-pdt.net/pyirc/ pyirc http://www.k-pdt.net/pyirc/
- very simple, not multithreaded - very simple, not multithreaded
- poor use of regexes, skybot has much better parsing, but it implements many more irc control codes - poor use of regexes, CloudBot has much better parsing, but it implements many more irc control codes
- can convert irc colors to vt100 escape codes -- should implement this - can convert irc colors to vt100 escape codes -- should implement this
- autoreconnect - autoreconnect
pybot pybot http://labix.org/pybot
- can handle multiple servers, but not multithreaded - can handle multiple servers, but not multithreaded
- ugly modules - ugly modules
- too many external dependencies - too many external dependencies

View file

@ -1,11 +1,12 @@
GOALS: GOALS:
simplicity * simplicity
as little boilerplate and magic as possible * as little boilerplate and magic as possible
multithreaded dispatch * multithreaded dispatch
plugins are located in plugins/ plugins are located in plugins/
input: input:
nick -- string, the nickname of whoever sent the message nick -- string, the nickname of whoever sent the message
channel -- string, the channel the message was sent on. Equal to nick if it's a private message. channel -- string, the channel the message was sent on. Equal to nick if it's a private message.
msg -- string, the line that was sent msg -- string, the line that was sent
@ -13,6 +14,7 @@ raw -- string, the raw full line that was sent
re -- the result of doing re.match(hook, msg) re -- the result of doing re.match(hook, msg)
attributes and methods of bot: attributes and methods of bot:
say(msg): obvious say(msg): obvious
reply(msg): say(input.nick + ": " + msg) reply(msg): say(input.nick + ": " + msg)
msg(target, msg): sends msg to target msg(target, msg): sends msg to target

View file

@ -1,7 +1,9 @@
All plugins need to 'from util import hook' if they want to be callable. All plugins need to 'from util import hook' if they want to be callable.
There are three ways to set when a plugin is called using There are three ways to set when a plugin is called using
decorators. @hook.command causes it to be callable using normal command decorators.
@hook.command causes it to be callable using normal command
syntax; an argument will register it under that name (so if my function is syntax; an argument will register it under that name (so if my function is
called foo and I use @hook.command, .foo will work; if I use called foo and I use @hook.command, .foo will work; if I use
@hook.command("bar"), .bar will work but not .foo). The first argument, inp, @hook.command("bar"), .bar will work but not .foo). The first argument, inp,