fix: attach first email doc with caption, second without

This commit is contained in:
Денис Кривоченко
2026-07-30 14:37:03 +07:00
parent e1a772ba0c
commit 3555d378b2
+5 -3
View File
@@ -447,9 +447,8 @@ async def instruct_router_handler(msg: Message):
raw_mail = ad_info.get("raw_mail") if ad_info else None
if raw_mail:
text = INSTRUCT_EMAIL_AVAILABLE(EMOJI_DIGITS, cn, raw_mail)
# Отправляем текст сообщения
await msg.answer(text, parse_mode="html")
# Затем отправляем оба документа
# Отправляем первую инструкцию с текстом-подписью
first = True
for instruct_path, file_name in [
(GMAIL_ANDROID_INSTRUCT_PATH, "Инструкция Android"),
(APPLE_INSTRUCT_PATH, "Инструкция Apple"),
@@ -458,7 +457,10 @@ async def instruct_router_handler(msg: Message):
await msg.bot.send_document(
chat_id=msg.chat_id,
file=FSInputFile(instruct_path, file_name=file_name),
caption=text if first else None,
parse_mode="html" if first else None,
)
first = False
else:
text = INSTRUCT_EMAIL_UNAVAILABLE(EMOJI_DIGITS, cn)
await msg.answer(text, parse_mode="html")