fix: use real ticket_id in Trueconf message and remove doc attachment when no access
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user