|
|
@@ -9,7 +9,7 @@ import commands.public, commands.admin, commands.games, commands.statistics
|
|
|
import events.on_welcome, events.on_join, events.on_kick, events.on_mode, events.on_pubmsg, events.on_action, events.on_whoreply, events.on_nick
|
|
|
from common import log
|
|
|
from common.networkservices import NickServ
|
|
|
-from events.common import Lastact, MessageStatistics
|
|
|
+from events.common import Lastact, MessageStatistics, Inform
|
|
|
|
|
|
bold = "\x02"
|
|
|
italic = "\x1D"
|
|
|
@@ -32,7 +32,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
self.protectees = {}
|
|
|
self.channelkeys = {}
|
|
|
|
|
|
- print("Starting pyRot, the third RotBot by tBkwtWS.")
|
|
|
+ log.info("Starting pyRot, the third RotBot by tBkwtWS.")
|
|
|
log.info("Connecting to " + host + ":" + str(port) + "/" + self.homechannel)
|
|
|
|
|
|
if usessl:
|
|
|
@@ -58,6 +58,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
def on_error(self, connection, event):
|
|
|
log.notice(str(event))
|
|
|
connection.privmsg(self.homechannel, "ERROR: " + str(event))
|
|
|
+ Inform.owners(self, connection, "Received error from server: " + str(event))
|
|
|
|
|
|
def on_nick(self, connection, event):
|
|
|
events.on_nick.process_event(self, connection, event)
|
|
|
@@ -74,7 +75,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
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.
|
|
|
del self.protectees[event.source.nick] # Delete from protectees.
|
|
|
|
|
|
@@ -87,7 +88,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
def on_quit(self, connection, event):
|
|
|
log.info(event)
|
|
|
|
|
|
- # Update protectees
|
|
|
+ # Update protectees.
|
|
|
if event.source.nick in self.protectees: # Protectee parted home channel.
|
|
|
del self.protectees[event.source.nick] # Delete from protectees.
|
|
|
|
|
|
@@ -100,7 +101,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
def on_invite(self, connection, event):
|
|
|
log.notice(event)
|
|
|
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 + ".")
|
|
|
+ Inform.operators(self, connection, "Received invitation to " + red + event.arguments[0] + reset + " from " + red + event.source.nick + reset + ".")
|
|
|
|
|
|
def on_topic(self, connection, event):
|
|
|
log.info(event)
|
|
|
@@ -121,6 +122,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
commands.admin.do_command(self, connection, event)
|
|
|
commands.statistics.do_command(self, connection, event)
|
|
|
commands.games.do_command(self, connection, event)
|
|
|
+ Inform.operators(self, connection, "PM from " + red + red + event.source.nick + grey + ": " + reset + event.arguments[0] + ".")
|
|
|
|
|
|
def on_pubnotice(self, connection, event):
|
|
|
log.info(event)
|
|
|
@@ -144,6 +146,7 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
connection.join(event.arguments[0].split(' ')[3], event.arguments[0].split(' ')[5][:-1])
|
|
|
except:
|
|
|
pass
|
|
|
+ Inform.owners(self, connection, "PM from " + red + red + event.source.nick + grey + ": " + reset + event.arguments[0] + ".")
|
|
|
|
|
|
def on_action(self, connection, event):
|
|
|
events.on_action.process_event(self, connection, event)
|
|
|
@@ -162,8 +165,9 @@ class PyRot(irc.bot.SingleServerIRCBot):
|
|
|
def on_yourebannedcreep(self, connection, event):
|
|
|
log.warning(event)
|
|
|
|
|
|
- def on_youwillbebanned(selfself, connection, event):
|
|
|
+ def on_youwillbebanned(self, connection, event):
|
|
|
log.warning(event)
|
|
|
+ Inform.operators(self, connection, "I will be banned " + red + event.arguments[0] + reset + " from " + red + event.source)
|
|
|
|
|
|
|
|
|
# DCC stuff from originalexample file.
|