summaryrefslogtreecommitdiff
path: root/logbot.py
diff options
context:
space:
mode:
authorChris Oliver <excid3@gmail.com>2010-02-08 23:04:00 -0600
committerChris Oliver <excid3@gmail.com>2010-02-08 23:04:00 -0600
commitdf6c918e403d09c51f0a8426260f2c5c2af5bc23 (patch)
treefd007b65d78fdf6776c4519cde8ef176dd7fbe73 /logbot.py
parent050a1530c342f3ac5bfcd0ec8b37ab37626ad75d (diff)
downloadlogbot-df6c918e403d09c51f0a8426260f2c5c2af5bc23.tar.xz
Added auto-identify
Diffstat (limited to 'logbot.py')
-rw-r--r--logbot.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/logbot.py b/logbot.py
index f115b2e..b25c9e0 100644
--- a/logbot.py
+++ b/logbot.py
@@ -56,12 +56,13 @@ html_header = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
class LogBot(object):
- def __init__(self, network, port, channels, owner, nick, folder, stylesheet):
+ def __init__(self, network, port, channels, owner, nick, password, folder, stylesheet):
self.network = network
self.port = port
self.channels = channels
self.owner = owner
self.nick = nick
+ self.password = password
self.folder = folder
self.stylesheet = stylesheet
@@ -90,6 +91,10 @@ class LogBot(object):
# Create a server object, connect and join the channel
self.server = self.irc.server()
self.server.connect(self.network, self.port, self.nick, ircname=self.nick)
+
+ if self.password:
+ self.server.privmsg("nickserv", "identify %s" % self.password)
+
for channel in self.channels:
self.server.join(channel)
@@ -241,11 +246,15 @@ def main(conf):
port = CONFIG.getint('irc', 'port')
channels = CONFIG.get('irc', 'channels').split(',')
nick = CONFIG.get('irc', 'nick')
+ try:
+ password = CONFIG.get('irc', 'password')
+ except:
+ password = None
owner = CONFIG.get('irc', 'owners').split(',')
logs_folder = CONFIG.get('log', 'folder')
stylesheet = CONFIG.get('log', 'stylesheet')
- bot = LogBot(network, port, channels, owner, nick, logs_folder, stylesheet)
+ bot = LogBot(network, port, channels, owner, nick, password, logs_folder, stylesheet)
try:
bot.start()
except KeyboardInterrupt: