From 8d26131fcda2f04d4867257d020da4f0f29f1fa3 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Sat, 13 Feb 2010 19:58:38 -0600 Subject: Missing ) and added nick/topic changes --- conf/example.conf | 4 +++- conf/stylesheet.css | 2 +- logbot.py | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/conf/example.conf b/conf/example.conf index 099ab9d..6a1ca9f 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -20,7 +20,9 @@ stylesheet = conf/stylesheet.css join = -!- %user% [%host%] has joined %channel% kick = -!- %user% was kicked from %channel% by %kicker% [%reason%] mode = -!- mode/%channel% [%modes% %person%] by %giver% +nick = %old% is now known as %new% part = -!- %user% has parted %channel% pubmsg = <%user%> %message% pubnotice = -%user%:%channel%- %message% -quit = -!- %user% has quit [%reason%] \ No newline at end of file +quit = -!- %user% has quit [%reason%] +topic = %user% changed topic of %channel% to: %topic% diff --git a/conf/stylesheet.css b/conf/stylesheet.css index 17318bd..ae84841 100644 --- a/conf/stylesheet.css +++ b/conf/stylesheet.css @@ -19,6 +19,6 @@ a:hover, .time:hover { text-decoration: underline; } .person { color: #DD1144; } -.join, .part, .quit, .kick, .mode { color: #42558C; } +.join, .part, .quit, .kick, .mode, .topic, .nick { color: #42558C; } .notice { color: #AE768C; } \ No newline at end of file diff --git a/logbot.py b/logbot.py index 459ddcb..1abcd27 100644 --- a/logbot.py +++ b/logbot.py @@ -127,6 +127,20 @@ class LogBot(SingleServerIRCBot): def on_privmsg(self, c, e): pass + def on_topic(self, c, e): + user = nm_to_n(e.source()) + channel = e.target() + topic = e.arguments()[0] + self.write(channel, self.format["topic"].replace("%user%", user) \ + .replace("%channel%", channel) \ + .replace("%topic%", topic)) + + def on_nick(self, c, e): + new = nm_to_n(e.source()) + old = e.target() + self.write(channel, self.format["nick"].replace("%old%", old) \ + .replace("%new%", new)) + def on_pubnotice(self, c, e): user = nm_to_n(e.source()) channel = e.target() @@ -232,7 +246,8 @@ def main(conf): stylesheet = CONFIG.get("log", "stylesheet") # Get the formation information - types = ["join", "kick", "mode", "part", "pubmsg", "pubnotice", "quit"] + types = ["join", "kick", "mode", "part", "pubmsg", "pubnotice", "quit", + "topic"] format = {} for type in types: format[type] = CONFIG.get("format", type) -- cgit v1.2.3