diff --git a/adapters/tg.py b/adapters/tg.py index 756167c..43eda7a 100644 --- a/adapters/tg.py +++ b/adapters/tg.py @@ -73,7 +73,7 @@ class TelegramAdapter: # unpin 模块 # 不知道为什么检测不到频道的消息被置顶这个事件,暂时认为所有的频道消息都是被置顶的 unpin_router.message(F.chat.type.in_({'group', 'supergroup'}) & F.sender_chat & ( - F.sender_chat.type == 'channel'))( + F.sender_chat.type == 'channel') & F.is_automatic_forward)( handle_unpin_channel_message) # repeater 模块 repeater_router.message(F.chat.type.in_({'group', 'supergroup'}))(MessageRepeater().handle_message) diff --git a/core/inline.py b/core/inline.py index df60289..29d1459 100644 --- a/core/inline.py +++ b/core/inline.py @@ -1,6 +1,6 @@ from aiogram.enums import ParseMode from aiogram.types import InlineQuery, InlineQueryResultArticle, InputTextMessageContent -from aiogram.utils.formatting import Text, ExpandableBlockQuote +from aiogram.utils.formatting import BlockQuote, Text async def handle_inline_query(query: InlineQuery): @@ -162,11 +162,10 @@ async def handle_inline_query(query: InlineQuery): thumbnail_url=thumbnail, input_message_content=InputTextMessageContent( message_text=f"{title}\n{video_type} | 作者:{author} | " - f"播放量:{play} {Text(ExpandableBlockQuote(description)).as_html()}", - parse_mode=ParseMode.HTML, - disable_web_page_preview=True + f"播放量:{play} {Text(BlockQuote(description)).as_html()}", + parse_mode=ParseMode.HTML ), - description=f"{bvid} | {author} | {play}次播放" + description=f"{bvid} | 作者:{author} | 播放量:{play}" )) if b23_query and search_results: await query.answer(results=search_results, cache_time=0)