Compare commits

...

2 commits

Author SHA1 Message Date
e5cbed59d3
Merge branch 'master' into info_command 2025-05-18 11:08:52 +03:00
84a897868d feat: use LinkPreviewOptions in answer_query
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
2025-05-18 11:08:09 +03:00

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
@ -67,9 +67,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)
)