Add priority attribute to handler, sort and load handler by priority.

- Set a low load priority in handlers/useful.py to ensure it loads last. (ensure
  'latest_handle_messages' registered last to prevent other commands from failing.)
This commit is contained in:
F4ria
2024-07-09 23:07:40 +08:00
parent 89b619da3b
commit 3f1ca37e53
2 changed files with 13 additions and 2 deletions

View File

@ -13,6 +13,9 @@ from . import *
from telegramify_markdown.customize import markdown_symbol
# Define the load priority, lower numbers have higher priority
load_priority = 1000
# If you want, Customizing the head level 1 symbol
markdown_symbol.head_level_1 = "📌"
markdown_symbol.link = "🔗" # If you want, Customizing the link symbol
@ -196,7 +199,7 @@ def latest_handle_messages(message: Message, bot: TeleBot):
elif message.text.startswith(
(
"md",
"chatgpt",
"gpt",
"gemini",
"qwen",
"map",