This commit is contained in:
机器人总动员 2021-05-09 22:02:32 +08:00
parent b4e2c94bd4
commit 8af81b178c
2 changed files with 7 additions and 4 deletions

View File

@ -2,3 +2,6 @@ TOKEN = "1749418611:AAGOV2XB5mkMXqX-J_wtNu7KkrkhO_Xylmg"
# 频率限制次数每个群每小时内只能主动触发10次任务
LIMIT_COUNT = 10
# 私有模式,仅授权群组可用 0:关闭 1:打开
EXCLUSIVE_MODE = 0

View File

@ -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: