fix: send email text once, then attach docs without caption

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