diff --git a/adapters/tg.py b/adapters/tg.py index 43eda7a..756167c 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.is_automatic_forward)( + F.sender_chat.type == 'channel'))( 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 29d1459..df60289 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 BlockQuote, Text +from aiogram.utils.formatting import Text, ExpandableBlockQuote async def handle_inline_query(query: InlineQuery): @@ -162,10 +162,11 @@ 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(BlockQuote(description)).as_html()}", - parse_mode=ParseMode.HTML + f"播放量:{play} {Text(ExpandableBlockQuote(description)).as_html()}", + parse_mode=ParseMode.HTML, + disable_web_page_preview=True ), - 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)