fix: add both command and regex

Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
Frost Ming 2023-12-12 09:52:10 +08:00
parent 40b10ab9ad
commit a845bcba57
No known key found for this signature in database
GPG Key ID: 5BFA9CB4DDA943BF

View File

@ -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:"