AI Update: تست اف تی پی نتیجه رو درست نمیگه

This commit is contained in:
Antigravity Bot
2026-08-30 21:23:34 +03:30
parent ab4764f521
commit 5ab0a40b03
4 changed files with 91 additions and 26 deletions
+17 -2
View File
@@ -4832,9 +4832,24 @@ async def callback_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
path=curr_proj.ftp_path or "/",
tls=curr_proj.ftp_tls,
)
icon = "" if test_ok else ""
res_card = (
f"{icon} <b>نتیجه تست اتصال FTP:</b>\n\n"
f"• 🌐 <b>هاست:</b> <code>{escape_html(curr_proj.ftp_host)}:{curr_proj.ftp_port}</code>\n"
f"• 👤 <b>نام کاربری:</b> <code>{escape_html(curr_proj.ftp_user or '(بدون نام کاربری)')}</code>\n"
f"• 📂 <b>مسیر:</b> <code>{escape_html(curr_proj.ftp_path or '/')}</code>\n"
f"• 🔒 <b>پروتکل:</b> {'FTPS/TLS امن 🔒' if curr_proj.ftp_tls else 'FTP معمولی'}\n\n"
f"📋 <b>گزارش ارتباط:</b>\n{test_msg}"
) if is_fa else (
f"{icon} <b>FTP Connection Test Result:</b>\n\n"
f"• 🌐 <b>Host:</b> <code>{escape_html(curr_proj.ftp_host)}:{curr_proj.ftp_port}</code>\n"
f"• 👤 <b>User:</b> <code>{escape_html(curr_proj.ftp_user or '(none)')}</code>\n"
f"• 📂 <b>Path:</b> <code>{escape_html(curr_proj.ftp_path or '/')}</code>\n"
f"• 🔒 <b>Protocol:</b> {'Secure FTPS/TLS 🔒' if curr_proj.ftp_tls else 'Standard FTP'}\n\n"
f"📋 <b>Status:</b>\n{test_msg}"
)
try:
alert_text = ("✅ اتصال FTP برقرار است" if test_ok else "❌ خطا در اتصال FTP") + f"\n{test_msg}"
await query.answer(alert_text[:200], show_alert=True)
await query.message.reply_html(res_card, disable_web_page_preview=True)
except Exception:
pass
else: