From 68a614e2c52db7c292b35de9d5073d7f3f86bc12 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: Wed, 5 May 2021 16:27:21 +0800 Subject: [PATCH] init --- func.py | 5 ++++- main.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/func.py b/func.py index 260c370..ededd26 100644 --- a/func.py +++ b/func.py @@ -20,6 +20,8 @@ def chat_content_exec(update, context): r = connector.get_connection() text = update.message.text chat_type = update.effective_chat.type + if chat_type != "supergroup": + return user_id = update.effective_user.id chat_id = update.effective_message.chat_id try: @@ -27,12 +29,13 @@ def chat_content_exec(update, context): except Exception as e: username = update.effective_user.id print("\n---------------------------") - print("内容: " + text) + print("内容: " + text[:10]) print("群组类型: " + str(chat_type)) print("用户ID: " + str(user_id)) print("chat_id: " + str(chat_id)) if "/" in text: print("这是一条指令信息,跳过") + return else: if text[-1] not in [",", "。", "!", ":", "?", "!", "?", ",", ":", "."]: r.append("{}_chat_content".format(chat_id), text + "。") diff --git a/main.py b/main.py index 8c8ce03..81d9ac5 100644 --- a/main.py +++ b/main.py @@ -5,8 +5,8 @@ import schedule from task import do_task import threading -# schedule.every().day.at('16:20').do(task).tag('task') -schedule.every(1).minutes.do(do_task).tag('task') +schedule.every().day.at('16:20').do(do_task).tag('task') +# schedule.every(1).minutes.do(do_task).tag('task') threading.Thread(target=check_schedule).start()