mirror of
https://github.com/cdryzun/tg_bot_collections.git
synced 2025-04-29 16:57:09 +08:00
fix: without command
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
b9ed871d58
commit
bd202851e0
@ -100,7 +100,7 @@ def wrap_handler(handler: T, bot: TeleBot) -> T:
|
|||||||
def wrapper(message: Message, *args: Any, **kwargs: Any) -> None:
|
def wrapper(message: Message, *args: Any, **kwargs: Any) -> None:
|
||||||
try:
|
try:
|
||||||
m = ""
|
m = ""
|
||||||
if message.text == "/answer_it":
|
if message.text.find("answer_it") != -1:
|
||||||
# for answer_it no args
|
# for answer_it no args
|
||||||
return handler(message, *args, **kwargs)
|
return handler(message, *args, **kwargs)
|
||||||
elif message.text is not None:
|
elif message.text is not None:
|
||||||
|
@ -66,7 +66,13 @@ def md_handler(message: Message, bot: TeleBot):
|
|||||||
def latest_handle_messages(message: Message, bot: TeleBot):
|
def latest_handle_messages(message: Message, bot: TeleBot):
|
||||||
"""ignore"""
|
"""ignore"""
|
||||||
chat_id = message.chat.id
|
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):
|
def answer_it_handler(message: Message, bot: TeleBot):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user