a pure python3 IRC channel bot.
R E A D M E
WTFBOT 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/wtfbot/#files
untar, cd into the directory and run:
> ./bin/wtfbot -m rss,entry,show localhost \#dunkbots wtfbot
to have it connect to irc, join the channel and do nothing, users have to be !meet <nick> before they can give commands. WTFBOT 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 wtfbot --upgrade
if you want to develop on the bot clone the source at github.:
> git clone https://github.com/bthate/wtfbot > cd wtfbot > sudo python3 setup.py install
I R C
for IRC use <server> <channel> <nick> and the bot will connect and join the channel:
> wtfbot -m rss,entry,show irc.freenode.net \#dunkbots wtfbot
you can use the -b option to start the bot in the background and logfiles can be found in ~/.wtfbot/logs.
B O O T
if you want to have the daemon started at boot, run:
> sudo init.d/install
this will install an wtfbot service and starts WTFBOT on boot.
R S S
> wtfbot -x rss https://news.ycombinator.com/rss ok 1
you can use the find command to see what urls are registered:
> wtfbot -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 ~/.wtfbot/logs/wtfbot.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
WTFBOT contains the following modules:
wtf - object bot framework. wtf.log - log callback. wtf.rss - rss feed to channel. wtf.show - show runtime information. wtf.udp - udp to channel. wtf.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.
> wtfbot -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 wtfbot-2.tar.gz (23.7 kB)||File type Source||Python version None||Upload date||Hashes View|