thehamkercat 5 лет назад
Родитель
Сommit
15dac2ff65
3 измененных файлов с 14 добавлено и 1 удалено
  1. 8 0
      app.json
  2. 5 1
      sample_config.py
  3. 1 0
      wbb/__init__.py

+ 8 - 0
app.json

@@ -78,6 +78,14 @@
         "LOG_MENTIONS": {
             "description": "Fill 1 to turn this one, or 0 to turn it off.",
             "required": true
+        },
+        "USERBOT_PREFIX": {
+            "description": "Userbot command prefix, Leave it empty if you don't know what that is.",
+            "required": false
+        },
+        "SPAM_CHECK_EXCEPTION_GROUPS": {
+            "description": "Groups where spam scans shouldn't happen, leave it empty if you don't know what that is",
+            "required": false
         }
     }
 }

+ 5 - 1
sample_config.py

@@ -7,7 +7,7 @@ if HEROKU:
     API_ID = int(environ.get("API_ID", 6))
     API_HASH = environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
     SESSION_STRING = environ.get("SESSION_STRING", None)
-    USERBOT_PREFIX = environ.get("USERBOT_PREFIX", None)
+    USERBOT_PREFIX = environ.get("USERBOT_PREFIX", ".")
     SUDO_USERS_ID = list(
         int(x) for x in environ.get("SUDO_USERS_ID", "").split()
     )
@@ -22,6 +22,9 @@ if HEROKU:
     LOG_MENTIONS = (
         True if int(environ.get("LOG_MENTIONS", None)) == 1 else False
     )
+    SPAM_CHECK_EXCEPTION_GROUPS = list(
+            int(y) for y in environ.get("SPAM_CHECK_EXCEPTION_GROUPS", []).split()
+            )
 else:
     BOT_TOKEN = "467677575:YZfaakjwd545dfg-N6JStihhuw5gQeZHntc"
     API_ID = 123456
@@ -43,3 +46,4 @@ else:
     ARQ_API_KEY = "Get this from @ARQRobot"
     ARQ_API_URL = "http://thearq.tech"
     LOG_MENTIONS = True
+    SPAM_CHECK_EXCEPTION_GROUPS = [] #Leave it empty if you don't know about it

+ 1 - 0
wbb/__init__.py

@@ -134,6 +134,7 @@ def get_info(app, app2):
     all_ub_chats = [i.chat.id for i in app2.iter_dialogs() if i.chat.type in ['group', 'supergroup', 'channel']]
     ub_b_common_chats = [i.id for i in app2.get_common_chats(BOT_ID)]
     USERBOT_BOT_CHAT_DIFFERENCE = list(set(all_ub_chats).difference(ub_b_common_chats))
+    USERBOT_BOT_CHAT_DIFFERENCE = [x for x in USERBOT_BOT_CHAT_DIFFERENCE if x not in SPAM_CHECK_EXCEPTION_GROUPS]
 
 
 print("[INFO]: STARTING BOT CLIENT")