-
-
Save dpk/c3b4bf519b5eb0d1a3be to your computer and use it in GitHub Desktop.
loggy.py: log mode changes and kicks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- loggy.py 2008-09-26 13:48:19.000000000 +0100 | |
+++ loggy.py 2012-11-08 17:52:46.000000000 +0000 | |
@@ -138,6 +138,12 @@ | |
msg = '*** %s has parted %s (%s)' | |
self.log(msg % (origin.nick, self.channel, message)) | |
+ def logkick(self, origin, command, channel, args, text): | |
+ reason = '' | |
+ if text: | |
+ reason = ' (%s)' % text | |
+ self.log('*** %s kicked %s from %s%s' % (origin.nick, args[2], self.channel, reason)) | |
+ | |
def logquit(self, origin, command, channel, args, text): | |
message = text | |
self.log('*** %s has quit (%s)' % (origin.nick, message)) | |
@@ -147,6 +153,10 @@ | |
new = text | |
self.log('*** %s is now known as %s' % (old, new)) | |
+ def logmodechange(self, origin, command, channel, args, text): | |
+ if origin.nick == self.nick: return | |
+ self.log('*** %s sets mode %s' % (origin.nick, ' '.join(args[2:]))) | |
+ | |
def logsettopic(self, origin, command, channel, args, text): | |
if args[1] == self.channel: | |
topic = text | |
@@ -175,7 +185,9 @@ | |
'JOIN': self.logjoin, | |
'PART': self.logpart, | |
'QUIT': self.logquit, | |
+ 'KICK': self.logkick, | |
'NICK': self.lognick, | |
+ 'MODE': self.logmodechange, | |
'TOPIC': self.logsettopic, | |
'332': self.logtopic, | |
'353': self.logusers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment