From f310eadb6a3fedcf79e4867e0cb63a2c6dff74fa Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 24 Jul 2010 11:45:46 -0500 Subject: [PATCH] usermode as config file option --- dr.botzo.cfg | 3 +++ dr.botzo.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dr.botzo.cfg b/dr.botzo.cfg index dacfc90..2971205 100644 --- a/dr.botzo.cfg +++ b/dr.botzo.cfg @@ -4,4 +4,7 @@ port = 6667 channel = #bss nick = dr_devzo name = dr. devzo + +usermode = -x + debug = true diff --git a/dr.botzo.py b/dr.botzo.py index ea552ea..0d9ab81 100755 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -9,8 +9,10 @@ import irclib # handler for when the bot has connected to IRC def on_connect(connection, event): # user modes - # TODO: config file - connection.mode(nick, '-x') + try: + usermode = config.get('IRC', 'usermode') + connection.mode(nick, usermode) + except NoOptionError: pass # join the specified channel # TODO: support multiple