|
|
|
@ -18,10 +18,14 @@ def on_connect(connection, event):
|
|
|
|
|
connection.mode(nick, usermode)
|
|
|
|
|
except NoOptionError: pass
|
|
|
|
|
|
|
|
|
|
# join the specified channel
|
|
|
|
|
# TODO: support multiple
|
|
|
|
|
if irclib.is_channel(channel):
|
|
|
|
|
connection.join(channel)
|
|
|
|
|
# join the specified channels
|
|
|
|
|
try:
|
|
|
|
|
autojoins = config.get('channels', 'autojoin').split(',')
|
|
|
|
|
for channel in autojoins:
|
|
|
|
|
if irclib.is_channel(channel):
|
|
|
|
|
connection.join(channel)
|
|
|
|
|
except NoOptionError: pass
|
|
|
|
|
|
|
|
|
|
#####
|
|
|
|
|
# on_privmsg
|
|
|
|
|
# private messages to the bot
|
|
|
|
@ -59,7 +63,6 @@ try:
|
|
|
|
|
# load connection info
|
|
|
|
|
server = config.get('IRC', 'server')
|
|
|
|
|
port = config.getint('IRC', 'port')
|
|
|
|
|
channel = config.get('IRC', 'channel')
|
|
|
|
|
nick = config.get('IRC', 'nick')
|
|
|
|
|
ircname = config.get('IRC', 'name')
|
|
|
|
|
except NoSectionError as e:
|
|
|
|
|