瀏覽代碼

Turn off tag log

TheHamkerCat 5 年之前
父節點
當前提交
dcbf822bef
共有 3 個文件被更改,包括 10 次插入 和 3 次删除
  1. 4 0
      app.json
  2. 2 1
      sample_config.py
  3. 4 2
      wbb/modules/taglogger.py

+ 4 - 0
app.json

@@ -74,6 +74,10 @@
         "ARQ_API_KEY": {
             "description": "Get this from @ARQRobot.",
             "required": true
+        },
+        "LOG_MENTIONS": {
+            "description": "Fill 1 to turn this one, or 0 to turn it off.",
+            "required": true
         }
     }
 }

+ 2 - 1
sample_config.py

@@ -19,6 +19,7 @@ if HEROKU:
     MONGO_DB_URI = environ.get("MONGO_DB_URI", None)
     ARQ_API_URL = environ.get("ARQ_API_URL", None)
     ARQ_API_KEY = environ.get("ARQ_API_KEY", None)
+    LOG_MENTIONS = True if int(environ.get("LOG_MENTIONS", None)) == 1 else False
 else:
     BOT_TOKEN = "467677575:YZfaakjwd545dfg-N6JStihhuw5gQeZHntc"
     API_ID = 123456
@@ -38,5 +39,5 @@ else:
     WELCOME_DELAY_KICK_SEC = 300
     MONGO_DB_URI = "mongodb+srv://username:password@cluster0.ksiis.mongodb.net/YourDataBaseName?retryWrites=true&w=majority"
     ARQ_API_KEY = "Get this from @ARQRobot"
-    # NOTE Don't make changes below this line
     ARQ_API_URL = "http://thearq.tech"
+    LOG_MENTIONS = True

+ 4 - 2
wbb/modules/taglogger.py

@@ -2,8 +2,8 @@ from pykeyboard import InlineKeyboard
 from pyrogram import filters
 from pyrogram.types import InlineKeyboardButton, Message
 
-from wbb import (BOT_ID, LOG_GROUP_ID, USERBOT_ID, USERBOT_NAME,
-                 USERBOT_USERNAME, app, app2)
+from wbb import (BOT_ID, LOG_GROUP_ID, LOG_MENTIONS, USERBOT_ID,
+            USERBOT_NAME, USERBOT_USERNAME, app, app2)
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.filter_groups import taglog_group
 
@@ -47,6 +47,8 @@ async def sendLog(message: Message):
 )
 @capture_err
 async def tagLoggerFunc(_, message: Message):
+    if not LOG_MENTIONS:
+        return
     if IS_USERBOT_ONLINE:
         return
     if message.reply_to_message: