feat: use LinkPreviewOptions in answer_query

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2025-05-18 11:08:09 +03:00
parent f2b6a2ee8f
commit 84a897868d

View file

@ -1,7 +1,7 @@
from uuid import uuid4
from telegram import Update, InlineKeyboardButton, InlineQueryResultArticle, InputTextMessageContent, \
InlineKeyboardMarkup
InlineKeyboardMarkup, LinkPreviewOptions
from telegram.constants import ParseMode
from telegram.ext import ContextTypes
@ -70,9 +70,9 @@ async def answer_query(update: Update, query: str, data) -> None:
thumbnail_url=data['preview_file_url'],
input_message_content=InputTextMessageContent(
f"ID: <code>{query}</code> {rating}\n"
f"<a href='{data['large_file_url']}'><b>{characters} ({copyrights})</b> "
f"drawn by <b>{artists}</b></a>",
parse_mode=ParseMode.HTML
f"<b>{characters} ({copyrights})</b> drawn by <b>{artists}</b>",
parse_mode=ParseMode.HTML,
link_preview_options=LinkPreviewOptions(url=data['large_file_url'])
),
reply_markup=InlineKeyboardMarkup(keyboard)
)