pure python3 IRC channel bot.
R E A D M E
OBIRC is a IRC bot you can use to display RSS feeds, makes it possible to program your own module enabling your own commands and contains no copyright or LICENSE.
I N S T A L L
download the tarball from pypi, https://pypi.org/project/obirc/#files
untar, cd into the directory and run:
> ./bin/obirc -m rss,entry,show localhost \#dunkbots obirc
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 obirc --upgrade
if you want to develop on the bot clone the source at github.:
> git clone https://github.com/bthate/obirc > cd obirc > sudo python3 setup.py install
I R C
for IRC use <server> <channel> <nick> and the bot will connect and join the channel:
> obirc -m rss,entry,show irc.freenode.net \#dunkbots obirc2
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
> obirc -x rss https://news.ycombinator.com/rss ok 1
you can use the find command to see what urls are registered:
> obirc -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 ~/.obirc/logs/obirc.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:
obirc - object bot framework. obirc.log - log callback. obirc.rss - rss feed to channel. obirc.show - show runtime information. obirc.udp - udp to channel. obirc.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.
> obirc -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.
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 obirc-4.tar.gz (51.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|