|
|
@@ -52,7 +52,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
events.on_welcome.process_event(self, connection, event)
|
|
|
|
|
|
def on_error(self, connection, event):
|
|
|
- log.notice(event)
|
|
|
+ log.notice(str(event))
|
|
|
connection.privmsg(self.homechannel, "ERROR: " + event)
|
|
|
|
|
|
def on_nick(self, connection, event):
|
|
|
@@ -74,7 +74,10 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
del self.protectees[event.source.nick] # Delete from protectees.
|
|
|
|
|
|
# Update last act.
|
|
|
- Lastact.update(self, event.source.nick, "part", channel=event.target, lastact=event.arguments[0])
|
|
|
+ if event.arguments:
|
|
|
+ Lastact.update(self, event.source.nick, "part", channel=event.target, lastact=event.arguments[0])
|
|
|
+ else:
|
|
|
+ Lastact.update(self, event.source.nick, "part", channel=event.target)
|
|
|
|
|
|
def on_quit(self, connection, event):
|
|
|
|
|
|
@@ -83,7 +86,10 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
del self.protectees[event.source.nick] # Delete from protectees.
|
|
|
|
|
|
# Update last act.
|
|
|
- Lastact.update(self, event.source.nick, "quit", lastact=event.arguments[0])
|
|
|
+ if event.arguments:
|
|
|
+ Lastact.update(self, event.source.nick, "quit", lastact=event.arguments[0])
|
|
|
+ else:
|
|
|
+ Lastact.update(self, event.source.nick, "quit")
|
|
|
|
|
|
def on_invite(self, connection, event):
|
|
|
log.info(event)
|