From a845bcba5715b362412b467d00160b5f734c06c2 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 12 Dec 2023 09:52:10 +0800 Subject: [PATCH] fix: add both command and regex Signed-off-by: Frost Ming --- hy_tg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hy_tg.py b/hy_tg.py index 921ee08..624416c 100644 --- a/hy_tg.py +++ b/hy_tg.py @@ -106,6 +106,7 @@ def main(): print("Bot init done.") @bot.message_handler(commands=["github"]) + @bot.message_handler(regexp="^github:") def github_poster_handler(message: Message): reply_message = bot.reply_to(message, "Generating poster please wait:") m = message.text.strip().split(maxsplit=1)[1].strip() @@ -133,6 +134,7 @@ def main(): bot.delete_message(reply_message.chat.id, reply_message.message_id) @bot.message_handler(commands=["map"]) + @bot.message_handler(regexp="^map:") def map_handler(message: Message): reply_message = bot.reply_to( message, "Generating pretty map may take some time please wait:"