feat: attach Gmail Android and Apple email instructions when user has mail
This commit is contained in:
@@ -57,6 +57,16 @@ TRUECONF_INSTRUCT_PATH = os.path.join(
|
||||
"Проверка_наличия_и_авторизация_на_мобильном_устройстве_Trueconf.docx"
|
||||
)
|
||||
|
||||
GMAIL_ANDROID_INSTRUCT_PATH = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"Инструкция по настройке электронной почты GMAIL на Android.docx"
|
||||
)
|
||||
|
||||
APPLE_INSTRUCT_PATH = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"Инструкция по настройке электронной почты на устройствах Apple.docx"
|
||||
)
|
||||
|
||||
|
||||
# ВСПОМОГАТЕЛЬНАЯ ФУНКЦИЯ ОТПРАВКИ EMAIL УВЕДОМЛЕНИЙ
|
||||
|
||||
@@ -437,6 +447,18 @@ 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)
|
||||
# Отправляем обе инструкции
|
||||
for instruct_path, file_name in [
|
||||
(GMAIL_ANDROID_INSTRUCT_PATH, "Инструкция Android"),
|
||||
(APPLE_INSTRUCT_PATH, "Инструкция Apple"),
|
||||
]:
|
||||
if os.path.isfile(instruct_path):
|
||||
await msg.bot.send_document(
|
||||
chat_id=msg.chat_id,
|
||||
file=FSInputFile(instruct_path, file_name=file_name),
|
||||
caption=text,
|
||||
parse_mode="html"
|
||||
)
|
||||
else:
|
||||
text = INSTRUCT_EMAIL_UNAVAILABLE(EMOJI_DIGITS, cn)
|
||||
await msg.answer(text, parse_mode="html")
|
||||
|
||||
Reference in New Issue
Block a user