|
@@ -68,6 +68,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
events.on_mode.process_event(self, connection, event)
|
|
events.on_mode.process_event(self, connection, event)
|
|
|
|
|
|
|
|
def on_part(self, connection, event):
|
|
def on_part(self, connection, event):
|
|
|
|
|
+ log.info(event)
|
|
|
|
|
|
|
|
# Update protectees
|
|
# Update protectees
|
|
|
if event.target == self.homechannel and event.source.nick in self.protectees: # Protectee parted home channel.
|
|
if event.target == self.homechannel and event.source.nick in self.protectees: # Protectee parted home channel.
|
|
@@ -80,6 +81,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
Lastact.update(self, event.source.nick, "part", channel=event.target)
|
|
Lastact.update(self, event.source.nick, "part", channel=event.target)
|
|
|
|
|
|
|
|
def on_quit(self, connection, event):
|
|
def on_quit(self, connection, event):
|
|
|
|
|
+ log.info(event)
|
|
|
|
|
|
|
|
# Update protectees
|
|
# Update protectees
|
|
|
if event.source.nick in self.protectees: # Protectee parted home channel.
|
|
if event.source.nick in self.protectees: # Protectee parted home channel.
|
|
@@ -92,7 +94,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
Lastact.update(self, event.source.nick, "quit")
|
|
Lastact.update(self, event.source.nick, "quit")
|
|
|
|
|
|
|
|
def on_invite(self, connection, event):
|
|
def on_invite(self, connection, event):
|
|
|
- log.info(event)
|
|
|
|
|
|
|
+ log.notice(event)
|
|
|
if event.target == connection.get_nickname(): # Bot invited.
|
|
if event.target == connection.get_nickname(): # Bot invited.
|
|
|
connection.privmsg(self.homechannel, "Received invite to " + red + event.arguments[0] + reset + " from " + red + event.source.nick + reset + ".")
|
|
connection.privmsg(self.homechannel, "Received invite to " + red + event.arguments[0] + reset + " from " + red + event.source.nick + reset + ".")
|
|
|
|
|
|
|
@@ -122,7 +124,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
# Save statistic to database.
|
|
# Save statistic to database.
|
|
|
if not self.db.one("SELECT id FROM \"users\" WHERE name='" + event.source.nick + "' AND network='" + self.network + "'"): # Not on record.
|
|
if not self.db.one("SELECT id FROM \"users\" WHERE name='" + event.source.nick + "' AND network='" + self.network + "'"): # Not on record.
|
|
|
self.db.run("INSERT INTO \"users\" (name, network) VALUES ('" + event.source.nick + "', '" + self.network + "')") # Create record.
|
|
self.db.run("INSERT INTO \"users\" (name, network) VALUES ('" + event.source.nick + "', '" + self.network + "')") # Create record.
|
|
|
- self.db.run("UPDATE \"users\" SET messages=messages+1 WHERE name='" + event.source.nick + "' AND network='" + self.network + "'") # Increment record.
|
|
|
|
|
|
|
+ self.db.run("UPDATE \"users\" SET notices=notices+1, notices_words=notices_words+" + str(len(event.arguments[0].split())) + ", notices_characters=notices_characters+" + str(len(event.arguments[0])) + " WHERE name='" + event.source.nick + "' AND network='" + self.network + "'") # Increment record.
|
|
|
|
|
|
|
|
# Update last act.
|
|
# Update last act.
|
|
|
Lastact.update(self, event.source.nick, "notice", channel=event.target, lastact=event.arguments[0])
|
|
Lastact.update(self, event.source.nick, "notice", channel=event.target, lastact=event.arguments[0])
|