summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/example.conf3
-rw-r--r--logbot.py13
2 files changed, 13 insertions, 3 deletions
diff --git a/conf/example.conf b/conf/example.conf
index c5a1cdc..cc2a4e2 100644
--- a/conf/example.conf
+++ b/conf/example.conf
@@ -3,8 +3,9 @@ network = irc.freenode.net
port = 6667
channels = #keryx
nick = Timber
+password =
owners = excid3
[log]
folder = logs
-stylesheet = file:///C:\Users\Chris Oliver\Desktop\logbot\conf\stylesheet.css \ No newline at end of file
+stylesheet = file:///C:\Users\Chris Oliver\Desktop\logbot\conf\stylesheet.css
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: