fix: use real ticket_id in Trueconf message and remove doc attachment when no access

This commit is contained in:
Денис Кривоченко
2026-07-27 22:16:08 +07:00
parent 0cfef14722
commit f1709f16b6
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -279,9 +279,13 @@ async def instruct_router_handler(msg: Message):
else:
logger.info(f"User {cn} already has 2FA group. SD ticket creation skipped.")
# Показываем текст с результатом и отправляем документ с caption
# Показываем текст с результатом
text = INSTRUCT_TRUECONF_WITH_AD(EMOJI_DIGITS, cn, ticket_id)
if os.path.isfile(TRUECONF_INSTRUCT_PATH):
if ticket_id is not None:
# Нет доступа — отправляем текст без документа
await msg.answer(text, parse_mode="html")
elif os.path.isfile(TRUECONF_INSTRUCT_PATH):
# Есть доступ — отправляем документ с caption
await msg.bot.send_document(
chat_id=msg.chat_id,
file=FSInputFile(TRUECONF_INSTRUCT_PATH, file_name="Инструкция.docx"),