Skip to main content

OBJ package you can use to program IRC bots

Project description

OBJ is a pure python3 framework that allows storage of JSON object to a filestamped file on the disk.
OBJ uses a timestamped, type in filename, JSON stringified, files on filesystem backend and has timed based logging capabilities.
OBJ has been placed in the Public Domain and contains no copyright or LICENSE.


S O U R C E


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

obj.base - base classes.
obj.clock - repeaters.
obj.cmds - basic commands.
obj.command - parse a line into a command.
obj.fleet - list of bots.
obj.handler - event handler.
obj.loader - module loader.
obj.poller - polling bot.
obj.rss - rss feed fetcher.
obj.run - runtime objects.
obj.shell - shell related commands.
obj.store - timestamped json file backend.
obj.tasks - botz threads.
obj.users - manage users.
obj.utils - utility functions.


E D I T


use the ed command to edit OBJ objects:

> obj ed obj.kernel.cfg 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:

> obj -m mods

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

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

> s cmds

ed,find,hello,log,oper,restore,rm,show,todo


I N S T A L L


you can fetch OBJ from the following:

https://pypi.org/project/obj | http://bitbucket.org/bthate/obj


if you need botz 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 botz.

installation is through pypi:

> sudo pip3 install botz

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


C O N F I G U R A T I O N


obj includes one program, the obj shell:

> obj [-m mod1,mod2] command



H A V E F U N


bthate@dds.nl | botfather on #dunkbots at irc.freenode.net | xmpp: bart@xmpp.fi

Project details


Download files

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

Files for obj.irc, version 28
Filename, size File type Python version Upload date Hashes
Filename, size obj.irc-28.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page