tBKwtWS 7 жил өмнө
parent
commit
5cabf5f02a
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      events/on_action.py

+ 4 - 1
events/on_action.py

@@ -12,7 +12,10 @@ red = "\x0304"
 grey = "\x0314"
 
 def process_event(self, connection, event):
-    Replyto.name(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
+        if not self.db.one("SELECT chat FROM channels WHERE name='" + event.target + "' AND network='" + self.network + "'"):
+            return  # Stop if channelfunction chat if off.
+        Replyto.name(connection, event)
     
     # 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.