Prechádzať zdrojové kódy

Dont Replyto.name to slaps

tBKwtWS 7 rokov pred
rodič
commit
fa4e7d8a94
2 zmenil súbory, kde vykonal 9 pridanie a 2 odobranie
  1. 8 1
      events/on_action.py
  2. 1 1
      events/on_nick.py

+ 8 - 1
events/on_action.py

@@ -13,8 +13,15 @@ grey = "\x0314"
 
 def process_event(self, connection, event):
     if connection.get_nickname().lower() in event.arguments[0].lower() and event.source.nick is not connection.get_nickname(): # Bot's name was mentioned
+        
+        # Stop if channelfunction chat if off.
         if not self.db.one("SELECT chat FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'"):
-            return  # Stop if channelfunction chat if off.
+            return
+        
+        # Stop if it's a slap.
+        if event.arguemnts[0].startswith() == "slaps ":
+            return
+        
         Replyto.name(connection, event)
     
     # Save statistic to database.

+ 1 - 1
events/on_nick.py

@@ -8,7 +8,7 @@ def process_event(self, connection, event):
     if event.source.nick == connection.nickname:    # Preffered nick being changed.
         log.info("Assuming original nick.")
         NickServ.recover_nick(connection, self.password)
-            
+    
     if event.source.nick in self.protectees:    # Protectee chaning nick.
         del self.protectees[event.source.nick]  # Remove old nick from list.
         connection.who(event.target)    # Get whorepy to add new nick to protectees.