pure python3 library to program bots.
R E A D M E ###########
| LBOT is a pure python3 framework to program bots, provides an IRC bot to use and is extendible by programming your own commands. | LBOT uses a timestamped, type in filename, JSON stringified, files on filesystem backend and has timed based logging capabilities. | LBOT has been placed in the Public Domain and contains no copyright or LICENSE.
C O D E
.. autosummary:: :toctree: code :template: module.rst
lbot.all - include all modules. lbot.bot - bot base class lbot.clock - timers lbot.cmds - commands lbot.command - command parsing lbot.db - db backend lbot.errors - exceptions lbot.event - event class lbot.fleet - list of bots lbot.handler - event handler lbot.irc - irc bot lbot.kernel - core handler lbot.loader - module loader lbot.log - logging module lbot.obj - object base class. lbot.tasks - threads lbot.term - terminal handling lbot.udp - udp to channel relay lbot.user - manage users lbot.utils - utilities
I N S T A L L
if you need LBOT to have access to your local directory use this:
this will add your current directory to the pythonpath so the packages in it can be found by LBOT.
installation is through pypi:
sudo pip3 install zelf
you can also run the bot from the tarball at pypi and run it directly or install with setup.py:
python3 setup.py install --user
running from the mercurial repository is also possible:
hg clone http://bitbucket.org/bthate/zelf
lastely, you can also run directly from the tarball.
U S A G E
LBOT includes one program, the lbot shell:
lbot [-m mod1,mod2] command
to connect to irc use the -m zelf.irc option.
lbot -m zelf.irc -s irc.freenode.net -c #lbot -n lbot
use the ed command to edit the last object with a certain type of LBOT objects:
lbot ed zelf.entry.Log shell=False
P R O G R A M M I N G
programming your own commands is easy, your can load modules with the -m option. if you create a mods directory and put your hello.py module in it, you would use:
lbot -m mods
any command you have coded in hello.py would be available, see the
show cmds command.
lbot show cmds
a command is a function with one argument, the event that was generated on the bot.
def mycmd(event): <your code here>
you can use event.reply() to send response back to the user:
def hello(event): event.reply("hello %s" % event.nick)
after starting lbot with -m mods, you see the hello command added to the bot:
lbot -s cmds
H A V E F U N
enjoy the coding ! ;]
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size lbot-1.tar.gz (21.5 kB)||File type Source||Python version None||Upload date||Hashes View hashes|