fix: without command

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong0618 2024-06-15 15:55:16 +08:00
parent b9ed871d58
commit bd202851e0
2 changed files with 8 additions and 2 deletions

View File

@ -100,7 +100,7 @@ def wrap_handler(handler: T, bot: TeleBot) -> T:
def wrapper(message: Message, *args: Any, **kwargs: Any) -> None:
try:
m = ""
if message.text == "/answer_it":
if message.text.find("answer_it") != -1:
# for answer_it no args
return handler(message, *args, **kwargs)
elif message.text is not None:

View File

@ -66,7 +66,13 @@ def md_handler(message: Message, bot: TeleBot):
def latest_handle_messages(message: Message, bot: TeleBot):
"""ignore"""
chat_id = message.chat.id
chat_message_dict[chat_id] = message
# 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")):
return
else:
chat_message_dict[chat_id] = message
def answer_it_handler(message: Message, bot: TeleBot):