From 8af81b178c96546ad9acafa0f0e10d2f9165602c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E6=80=BB=E5=8A=A8=E5=91=98?= <73592731+devourbots@users.noreply.github.com> Date: Sun, 9 May 2021 22:02:32 +0800 Subject: [PATCH] None --- config.py | 3 +++ func.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index feabb83..ad3d082 100644 --- a/config.py +++ b/config.py @@ -2,3 +2,6 @@ TOKEN = "1749418611:AAGOV2XB5mkMXqX-J_wtNu7KkrkhO_Xylmg" # 频率限制次数,每个群每小时内,只能主动触发10次任务 LIMIT_COUNT = 10 + +# 私有模式,仅授权群组可用 0:关闭 1:打开 +EXCLUSIVE_MODE = 0 diff --git a/func.py b/func.py index c81636b..4423ed7 100644 --- a/func.py +++ b/func.py @@ -3,7 +3,7 @@ import time import connector import telegram from telegram.ext import CommandHandler, MessageHandler, Filters -from config import TOKEN, LIMIT_COUNT +from config import TOKEN, LIMIT_COUNT, EXCLUSIVE_MODE import schedule from task import add_task @@ -77,9 +77,9 @@ def chat_content_exec(update, context): # 限制文字长度不能超过80字 if len(text) > 80: return - # 取消注释开启独享模式(仅授权群组可用) - # if chat_id not in ["1231242141"]: - # return + # 独享模式(仅授权群组可用) + if chat_id not in ["1231242141"] and EXCLUSIVE_MODE == 1: + return try: username = update.effective_user.username except Exception as e: