diff --git a/plugins/system/inline.py b/plugins/system/inline.py index df7e88c..9f8dc0a 100644 --- a/plugins/system/inline.py +++ b/plugins/system/inline.py @@ -8,6 +8,7 @@ from telegram.ext import CallbackContext, InlineQueryHandler from core.plugin import handler, Plugin from core.wiki import WikiService +from utils.decorators.error import error_callable from utils.log import logger @@ -18,6 +19,7 @@ class Inline(Plugin): self.wiki_service = wiki_service @handler(InlineQueryHandler, block=False) + @error_callable async def inline_query(self, update: Update, _: CallbackContext) -> None: user = update.effective_user ilq = cast(InlineQuery, update.inline_query) diff --git a/utils/decorators/error.py b/utils/decorators/error.py index 8a9337e..f84ae1c 100644 --- a/utils/decorators/error.py +++ b/utils/decorators/error.py @@ -15,6 +15,8 @@ from utils.log import logger async def send_user_notification(update: Update, _: CallbackContext, text: str): + if update.inline_query is not None: # 忽略 inline_query + return effective_user = update.effective_user message = update.effective_message if message is None: