Skip to main content

framework to program bots.

Project description

R E A D M E ###########

| ZELF is a pure python3 framework to program bots, provides an IRC bot to use and is extendible by programming your own commands. | ZELF uses a timestamped, type in filename, JSON stringified, files on filesystem backend and has timed based logging capabilities. | ZELF has been placed in the Public Domain and contains no copyright or LICENSE.

C O D E

.. autosummary:: :toctree: code :template: module.rst

zelf.all                      - include all modules.
zelf.bot			  - bot base class
zelf.clock                    - timers
zelf.cmds			  - commands
zelf.command                  - command parsing
zelf.db			  - db backend
zelf.errors 		  - exceptions
zelf.event			  - event class
zelf.fleet                    - list of bots
zelf.handler                  - event handler
zelf.irc                      - irc bot
zelf.kernel			  - core handler
zelf.loader                   - module loader
zelf.log			  - logging module
zelf.obj			  - object base class.
zelf.tasks                    - threads
zelf.term 			  - terminal handling
zelf.udp			  - udp to channel relay
zelf.user                     - manage users
zelf.utils                    - utilities

I N S T A L L

if you need ZELF to have access to your local directory use this:

export PYTHONPATH="."

this will add your current directory to the pythonpath so the packages in it can be found by ZELF.

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

ZELF includes one program, the zelf shell:

zelf [-m mod1,mod2] command

to connect to irc use the -m zelf.irc option.

zelf -m zelf.irc -s irc.freenode.net -c #zelf -n zelf

use the ed command to edit the last object with a certain type of ZELF objects:

zelf 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:

zelf -m mods

any command you have coded in hello.py would be available, see the show cmds command.

zelf show cmds

a command is a function with one argument, the event that was generated on the bot.

example:

::

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 zelf with -m mods, you see the hello command added to the bot:

zelf s cmds

ed,find,hello,ps,rm,show,stop,undel

H A V E F U N

enjoy the coding ! ;]

Bart

bthate@dds.nl | botfather #dunkbots irc.freenode.net | https://pypi.org/project/zelf | http://bitbucket.org/bthate/zelf

Project details


Release history Release notifications

This version

1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for zelf.docs, version 1
Filename, size File type Python version Upload date Hashes
Filename, size zelf.docs-1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page