Browse Source

Filtering more messages

tBKwtWS 7 years ago
parent
commit
e87e18a6c5
1 changed files with 9 additions and 2 deletions
  1. 9 2
      irc/bot.py

+ 9 - 2
irc/bot.py

@@ -123,8 +123,15 @@ class PyRot(irc.bot.SingleServerIRCBot):
         commands.statistics.do_command(self, connection, event)
         commands.games.do_command(self, connection, event)
         if not event.source.nick == connection.get_nickname():
-            if event.arguments[0] == "Password authentication required for that command." or event.arguments[0] == "You are already identified." or event.arguments[0].startswith("You have been unbanned from"):
-                return
+            if event.source.nick == "NickServ":
+                if event.arguments[0] == event.arguments[0] == "You are already identified.":
+                    return
+            if event.source.nick == "ChanServ":
+                if event.arguments[0] == "Password authentication required for that command." or event.arguments[0] == "You have been unbanned from 0 channels." or event.arguments[0].startswith("You have been unbanned from") or event.arguemnts[0].endswith("autokick list is empty.") or event.arguments[0].startswith("You are already in"):
+                    return
+                if event.arguemnts[0].startswith("Channel ") and event.arguments[0].endswith(" has no key."):
+                    return
+                    
             Inform.owners(self, connection, "PM from " + red + red + event.source.nick + grey + ": " + reset + event.arguments[0])
     
     def on_pubnotice(self, connection, event):