mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-25 07:36:27 +00:00
🎨 为 inline_query
函数添加 error_callable
修饰器
This commit is contained in:
parent
0120984991
commit
0c51dd3c5d
@ -8,6 +8,7 @@ from telegram.ext import CallbackContext, InlineQueryHandler
|
|||||||
|
|
||||||
from core.plugin import handler, Plugin
|
from core.plugin import handler, Plugin
|
||||||
from core.wiki import WikiService
|
from core.wiki import WikiService
|
||||||
|
from utils.decorators.error import error_callable
|
||||||
from utils.log import logger
|
from utils.log import logger
|
||||||
|
|
||||||
|
|
||||||
@ -18,6 +19,7 @@ class Inline(Plugin):
|
|||||||
self.wiki_service = wiki_service
|
self.wiki_service = wiki_service
|
||||||
|
|
||||||
@handler(InlineQueryHandler, block=False)
|
@handler(InlineQueryHandler, block=False)
|
||||||
|
@error_callable
|
||||||
async def inline_query(self, update: Update, _: CallbackContext) -> None:
|
async def inline_query(self, update: Update, _: CallbackContext) -> None:
|
||||||
user = update.effective_user
|
user = update.effective_user
|
||||||
ilq = cast(InlineQuery, update.inline_query)
|
ilq = cast(InlineQuery, update.inline_query)
|
||||||
|
@ -15,6 +15,8 @@ from utils.log import logger
|
|||||||
|
|
||||||
|
|
||||||
async def send_user_notification(update: Update, _: CallbackContext, text: str):
|
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
|
effective_user = update.effective_user
|
||||||
message = update.effective_message
|
message = update.effective_message
|
||||||
if message is None:
|
if message is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user