From 30ffe918023fe4accb5b35f671c1aa18bf7ab379 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Sat, 15 Jun 2024 15:58:06 +0800 Subject: [PATCH] fix: ignore lastest message Signed-off-by: yihong0618 --- handlers/useful.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/handlers/useful.py b/handlers/useful.py index 6becd86..ad89772 100644 --- a/handlers/useful.py +++ b/handlers/useful.py @@ -69,7 +69,30 @@ def latest_handle_messages(message: Message, bot: TeleBot): # if is bot command, ignore if message.text.startswith("/"): return - elif message.text.startswith(("md", "chatgpt", "gemini", "qwen", "map", "github", "claude", "llama", "dify", "tts", "sd", "map", "yi")): + # start command ignore + elif message.text.startswith( + ( + "md", + "chatgpt", + "gemini", + "qwen", + "map", + "github", + "claude", + "llama", + "dify", + "tts", + "sd", + "map", + "yi", + ) + ): + return + # answer_it command ignore + elif message.text.startswith("answer_it"): + return + # if not text, ignore + elif not message.text: return else: chat_message_dict[chat_id] = message