From f122614b9fb84f23c9fc00db9595872a3e1d622d Mon Sep 17 00:00:00 2001 From: Redume Date: Thu, 9 Jan 2025 00:03:19 +0300 Subject: [PATCH] chore: Made a regular expression to remove the graph reference from the previews --- utils/inline_query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/inline_query.py b/utils/inline_query.py index edf921d..282ad95 100644 --- a/utils/inline_query.py +++ b/utils/inline_query.py @@ -1,5 +1,6 @@ from aiogram import types +import re async def reply(result_id: str, args: list, query: types.InlineQuery) -> None: if not args: @@ -15,7 +16,7 @@ async def reply(result_id: str, args: list, query: types.InlineQuery) -> None: article = types.InlineQueryResultArticle( id=f"{result_id}_{idx}", - title=title, + title=re.sub(r'\bГрафик\b|\[([^\]]+)\]\([^)]+\)', '', title, flags=re.IGNORECASE), thumbnail_url=img, description=description, input_message_content=types.InputTextMessageContent(