Skip to main content

OBI is a pure python3 IRC channel bot.

Project description

R E A D M E

OBI is a pure python3 IRC channel bot and contains no copyright or LICENSE.

I N S T A L L

download the tarball from pypi, https://pypi.org/project/obi/#files

untar, cd into the directory and run:

> ./bin/obi -m rss,entry,show localhost \#dunkbots obi

to have it connect to irc, join the channel and do nothing, users have to be !meet <nick> before they can give commands. obirc does it self not depend, you might need to install feedparser yourself to have rss working.

you can also download with pip3 and install globally.

> sudo pip3 install obi --upgrade

if you want to develop on the bot clone the source at github.:

> git clone https://github.com/bthate/obi
> cd obi
> sudo python3 setup.py install

I R C

for IRC use <server> <channel> <nick> and the bot will connect and join the channel:

> obi -m rss,entry,show irc.freenode.net \#dunkbots obi

you can use the -b option to start the bot in the background and logfiles can be found in ~/.obirc/logs.

B O O T

if you want to have the daemon started at boot, run:

> sudo init.d/install

this will install an obirc service and starts the obirc bot on boot.

R S S

add url:

> obi -x rss https://news.ycombinator.com/rss
ok 1

you can use the find command to see what urls are registered:

> obi -x rss
0 https://news.ycombinator.com/rss

U D P

using udp to relay text into a channel, start the bot with -m udp and use the obudp program to send text to the UDP to channel server:

> tail -f ~/.obi/logs/obi.log | obudp

U S E R S

the default shell user is root@shell and gives access to all the commands that are available. if you want to use users to control access to commands use the –users option.

> meet bart
~bart@localhost added.

you can also use the full userhost as a argument to meet:

> meet user@server
user user@server created

M O D U L E S

obirc contains the following modules:

obi      - object bot framework.
obi.log  - log callback.
obi.rss  - rss feed to channel.
obi.show - show runtime information.
obi.udp  - udp to channel.
obi.user - user management.

C O D E

if you want to add your own modules to the bot, you can put your .py files in a “mods” directory and use the -m option to point to that directory.

> obi -m mods -p

basic code is a function that gets an event as a argument:

def command(event):
    << your code here >>

to give feedback to the user use the event.reply(txt) method:

def command(event):
    event.reply("yooo %s" % event.origin)

have fun coding ;]

I N F O

you can contact me on IRC/freenode/#dunkbots.

botfather on #dunkbots irc.freenode.net

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 obi, version 2
Filename, size File type Python version Upload date Hashes
Filename, size obi-2.tar.gz (28.7 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