mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-16 20:27:08 +03:00
Add "Last Online" printing for Telegram bot (#3593)
This commit is contained in:
@@ -2952,10 +2952,12 @@ func (t *Tgbot) clientInfoMsg(
|
||||
}
|
||||
|
||||
status := t.I18nBot("tgbot.offline")
|
||||
isOnline := false
|
||||
if p.IsRunning() {
|
||||
for _, online := range p.GetOnlineClients() {
|
||||
if online == traffic.Email {
|
||||
status = t.I18nBot("tgbot.online")
|
||||
isOnline = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -2968,6 +2970,9 @@ func (t *Tgbot) clientInfoMsg(
|
||||
}
|
||||
if printOnline {
|
||||
output += t.I18nBot("tgbot.messages.online", "Status=="+status)
|
||||
if !isOnline && traffic.LastOnline > 0 {
|
||||
output += t.I18nBot("tgbot.messages.lastOnline", "Time=="+time.UnixMilli(traffic.LastOnline).Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
}
|
||||
if printActive {
|
||||
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 مفعل: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 مفعل: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 حالة الاتصال: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 آخر متصل: {{ .Time }}\r\n"
|
||||
"email" = "📧 الإيميل: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 رفع: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 تنزيل: ↓{{ .Download }}\r\n"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Active: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Enabled: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Connection status: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Last online: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Upload: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Download: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ Process Canceled! \n\nYou can /start again anytime. 🔄"
|
||||
"error_add_client" = "⚠️ Error:\n\n {{ .error }}"
|
||||
"using_default_value" = "Okay, I'll stick with the default value. 😊"
|
||||
"incorrect_input" ="Your input is not valid.\nThe phrases should be continuous without spaces.\nCorrect example: aaaaaa\nIncorrect example: aaa aaa 🚫"
|
||||
"incorrect_input" = "Your input is not valid.\nThe phrases should be continuous without spaces.\nCorrect example: aaaaaa\nIncorrect example: aaa aaa 🚫"
|
||||
"AreYouSure" = "Are you sure? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Result: ✅ Success"
|
||||
"FailedResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Result: ❌ Failed \n\n🛠️ Error: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Activo: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Habilitado: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Estado de conexión: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Última conexión: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Subida: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Bajada: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ ¡Proceso cancelado! \n\nPuedes /start de nuevo en cualquier momento. 🔄"
|
||||
"error_add_client" = "⚠️ Error:\n\n {{ .error }}"
|
||||
"using_default_value" = "Está bien, me quedaré con el valor predeterminado. 😊"
|
||||
"incorrect_input" ="Tu entrada no es válida.\nLas frases deben ser continuas sin espacios.\nEjemplo correcto: aaaaaa\nEjemplo incorrecto: aaa aaa 🚫"
|
||||
"incorrect_input" = "Tu entrada no es válida.\nLas frases deben ser continuas sin espacios.\nEjemplo correcto: aaaaaa\nEjemplo incorrecto: aaa aaa 🚫"
|
||||
"AreYouSure" = "¿Estás seguro? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Correo: {{ .ClientEmail }}\n🏁 Resultado: ✅ Éxito"
|
||||
"FailedResetTraffic" = "📧 Correo: {{ .ClientEmail }}\n🏁 Resultado: ❌ Fallido \n\n🛠️ Error: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 فعال: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 وضعیت: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 وضعیت اتصال: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 آخرین فعالیت: {{ .Time }}\r\n"
|
||||
"email" = "📧 ایمیل: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 آپلود↑: {{ .Upload }}\r\n"
|
||||
"download" = "🔽 دانلود↓: {{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ فرآیند لغو شد! \n\nمیتوانید هر زمان که خواستید /start را دوباره اجرا کنید. 🔄"
|
||||
"error_add_client" = "⚠️ خطا:\n\n {{ .error }}"
|
||||
"using_default_value" = "باشه، از مقدار پیشفرض استفاده میکنم. 😊"
|
||||
"incorrect_input" ="ورودی شما معتبر نیست.\nعبارتها باید بدون فاصله باشند.\nمثال صحیح: aaaaaa\nمثال نادرست: aaa aaa 🚫"
|
||||
"incorrect_input" = "ورودی شما معتبر نیست.\nعبارتها باید بدون فاصله باشند.\nمثال صحیح: aaaaaa\nمثال نادرست: aaa aaa 🚫"
|
||||
"AreYouSure" = "مطمئنی؟ 🤔"
|
||||
"SuccessResetTraffic" = "📧 ایمیل: {{ .ClientEmail }}\n🏁 نتیجه: ✅ موفقیتآمیز"
|
||||
"FailedResetTraffic" = "📧 ایمیل: {{ .ClientEmail }}\n🏁 نتیجه: ❌ ناموفق \n\n🛠️ خطا: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Aktif: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Diaktifkan: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Status Koneksi: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Terakhir online: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Unggah: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Unduh: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ Proses Dibatalkan! \n\nAnda dapat /start lagi kapan saja. 🔄"
|
||||
"error_add_client" = "⚠️ Kesalahan:\n\n {{ .error }}"
|
||||
"using_default_value" = "Oke, saya akan tetap menggunakan nilai default. 😊"
|
||||
"incorrect_input" ="Masukan Anda tidak valid.\nFrasa harus berlanjut tanpa spasi.\nContoh benar: aaaaaa\nContoh salah: aaa aaa 🚫"
|
||||
"incorrect_input" = "Masukan Anda tidak valid.\nFrasa harus berlanjut tanpa spasi.\nContoh benar: aaaaaa\nContoh salah: aaa aaa 🚫"
|
||||
"AreYouSure" = "Apakah kamu yakin? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Hasil: ✅ Berhasil"
|
||||
"FailedResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Hasil: ❌ Gagal \n\n🛠️ Kesalahan: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 有効:{{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 有効化済み:{{ .Enable }}\r\n"
|
||||
"online" = "🌐 接続ステータス:{{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 最終オンライン: {{ .Time }}\r\n"
|
||||
"email" = "📧 メール:{{ .Email }}\r\n"
|
||||
"upload" = "🔼 アップロード↑:{{ .Upload }}\r\n"
|
||||
"download" = "🔽 ダウンロード↓:{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ プロセスがキャンセルされました!\n\nいつでも /start で再開できます。 🔄"
|
||||
"error_add_client" = "⚠️ エラー:\n\n {{ .error }}"
|
||||
"using_default_value" = "わかりました、デフォルト値を使用します。 😊"
|
||||
"incorrect_input" ="入力が無効です。\nフレーズはスペースなしで続けて入力してください。\n正しい例: aaaaaa\n間違った例: aaa aaa 🚫"
|
||||
"incorrect_input" = "入力が無効です。\nフレーズはスペースなしで続けて入力してください。\n正しい例: aaaaaa\n間違った例: aaa aaa 🚫"
|
||||
"AreYouSure" = "本当にいいですか?🤔"
|
||||
"SuccessResetTraffic" = "📧 メール: {{ .ClientEmail }}\n🏁 結果: ✅ 成功"
|
||||
"FailedResetTraffic" = "📧 メール: {{ .ClientEmail }}\n🏁 結果: ❌ 失敗 \n\n🛠️ エラー: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Ativo: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Ativado: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Status da conexão: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Última vez online: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Upload: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Download: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ Processo Cancelado! \n\nVocê pode iniciar novamente a qualquer momento com /start. 🔄"
|
||||
"error_add_client" = "⚠️ Erro:\n\n {{ .error }}"
|
||||
"using_default_value" = "Tudo bem, vou manter o valor padrão. 😊"
|
||||
"incorrect_input" ="Sua entrada não é válida.\nAs frases devem ser contínuas, sem espaços.\nExemplo correto: aaaaaa\nExemplo incorreto: aaa aaa 🚫"
|
||||
"incorrect_input" = "Sua entrada não é válida.\nAs frases devem ser contínuas, sem espaços.\nExemplo correto: aaaaaa\nExemplo incorreto: aaa aaa 🚫"
|
||||
"AreYouSure" = "Você tem certeza? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Resultado: ✅ Sucesso"
|
||||
"FailedResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Resultado: ❌ Falhou \n\n🛠️ Erro: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Активен: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Активен: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Статус соединения: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Был(а) в сети: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Исходящий трафик: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Входящий трафик: ↓{{ .Download }}\r\n"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Aktif: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Etkin: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Bağlantı durumu: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Son çevrimiçi: {{ .Time }}\r\n"
|
||||
"email" = "📧 E-posta: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Yükleme: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 İndirme: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ İşlem iptal edildi! \n\nİstediğiniz zaman /start ile yeniden başlayabilirsiniz. 🔄"
|
||||
"error_add_client" = "⚠️ Hata:\n\n {{ .error }}"
|
||||
"using_default_value" = "Tamam, varsayılan değeri kullanacağım. 😊"
|
||||
"incorrect_input" ="Girdiğiniz değer geçerli değil.\nKelime öbekleri boşluk olmadan devam etmelidir.\nDoğru örnek: aaaaaa\nYanlış örnek: aaa aaa 🚫"
|
||||
"incorrect_input" = "Girdiğiniz değer geçerli değil.\nKelime öbekleri boşluk olmadan devam etmelidir.\nDoğru örnek: aaaaaa\nYanlış örnek: aaa aaa 🚫"
|
||||
"AreYouSure" = "Emin misin? 🤔"
|
||||
"SuccessResetTraffic" = "📧 E-posta: {{ .ClientEmail }}\n🏁 Sonuç: ✅ Başarılı"
|
||||
"FailedResetTraffic" = "📧 E-posta: {{ .ClientEmail }}\n🏁 Sonuç: ❌ Başarısız \n\n🛠️ Hata: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Активний: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Увімкнено: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Стан підключення: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Був(ла) онлайн: {{ .Time }}\r\n"
|
||||
"email" = "📧 Електронна пошта: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Upload: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Download: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ Процес скасовано! \n\nВи можете знову розпочати, використовуючи /start у будь-який час. 🔄"
|
||||
"error_add_client" = "⚠️ Помилка:\n\n {{ .error }}"
|
||||
"using_default_value" = "Гаразд, залишу значення за замовчуванням. 😊"
|
||||
"incorrect_input" ="Ваш ввід невірний.\nФрази повинні бути без пробілів.\nПравильний приклад: aaaaaa\nНеправильний приклад: aaa aaa 🚫"
|
||||
"incorrect_input" = "Ваш ввід невірний.\nФрази повинні бути без пробілів.\nПравильний приклад: aaaaaa\nНеправильний приклад: aaa aaa 🚫"
|
||||
"AreYouSure" = "Ви впевнені? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Електронна пошта: {{ .ClientEmail }}\n🏁 Результат: ✅ Успішно"
|
||||
"FailedResetTraffic" = "📧 Електронна пошта: {{ .ClientEmail }}\n🏁 Результат: ❌ Невдача \n\n🛠️ Помилка: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 Đang hoạt động: {{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 Đã bật: {{ .Enable }}\r\n"
|
||||
"online" = "🌐 Trạng thái kết nối: {{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 Lần online gần nhất: {{ .Time }}\r\n"
|
||||
"email" = "📧 Email: {{ .Email }}\r\n"
|
||||
"upload" = "🔼 Tải lên: ↑{{ .Upload }}\r\n"
|
||||
"download" = "🔽 Tải xuống: ↓{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ Quá trình đã bị hủy! \n\nBạn có thể bắt đầu lại bất cứ lúc nào bằng cách nhập /start. 🔄"
|
||||
"error_add_client" = "⚠️ Lỗi:\n\n {{ .error }}"
|
||||
"using_default_value" = "Được rồi, tôi sẽ sử dụng giá trị mặc định. 😊"
|
||||
"incorrect_input" ="Dữ liệu bạn nhập không hợp lệ.\nCác chuỗi phải liền mạch và không có dấu cách.\nVí dụ đúng: aaaaaa\nVí dụ sai: aaa aaa 🚫"
|
||||
"incorrect_input" = "Dữ liệu bạn nhập không hợp lệ.\nCác chuỗi phải liền mạch và không có dấu cách.\nVí dụ đúng: aaaaaa\nVí dụ sai: aaa aaa 🚫"
|
||||
"AreYouSure" = "Bạn có chắc không? 🤔"
|
||||
"SuccessResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Kết quả: ✅ Thành công"
|
||||
"FailedResetTraffic" = "📧 Email: {{ .ClientEmail }}\n🏁 Kết quả: ❌ Thất bại \n\n🛠️ Lỗi: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
"same" = "相同"
|
||||
"inboundData" = "入站数据"
|
||||
"exportInbound" = "导出入站规则"
|
||||
"import"="导入"
|
||||
"import" = "导入"
|
||||
"importInbound" = "导入入站规则"
|
||||
"periodicTrafficResetTitle" = "流量重置"
|
||||
"periodicTrafficResetDesc" = "按指定间隔自动重置流量计数器"
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 激活:{{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 已启用:{{ .Enable }}\r\n"
|
||||
"online" = "🌐 连接状态:{{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 上次在线: {{ .Time }}\r\n"
|
||||
"email" = "📧 邮箱:{{ .Email }}\r\n"
|
||||
"upload" = "🔼 上传↑:{{ .Upload }}\r\n"
|
||||
"download" = "🔽 下载↓:{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ 进程已取消!\n\n您可以随时使用 /start 重新开始。 🔄"
|
||||
"error_add_client" = "⚠️ 错误:\n\n {{ .error }}"
|
||||
"using_default_value" = "好的,我会使用默认值。 😊"
|
||||
"incorrect_input" ="您的输入无效。\n短语应连续输入,不能有空格。\n正确示例: aaaaaa\n错误示例: aaa aaa 🚫"
|
||||
"incorrect_input" = "您的输入无效。\n短语应连续输入,不能有空格。\n正确示例: aaaaaa\n错误示例: aaa aaa 🚫"
|
||||
"AreYouSure" = "你确定吗?🤔"
|
||||
"SuccessResetTraffic" = "📧 邮箱: {{ .ClientEmail }}\n🏁 结果: ✅ 成功"
|
||||
"FailedResetTraffic" = "📧 邮箱: {{ .ClientEmail }}\n🏁 结果: ❌ 失败 \n\n🛠️ 错误: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
"same" = "相同"
|
||||
"inboundData" = "入站資料"
|
||||
"exportInbound" = "匯出入站規則"
|
||||
"import"="匯入"
|
||||
"import" = "匯入"
|
||||
"importInbound" = "匯入入站規則"
|
||||
"periodicTrafficResetTitle" = "流量重置"
|
||||
"periodicTrafficResetDesc" = "按指定間隔自動重置流量計數器"
|
||||
@@ -663,6 +663,7 @@
|
||||
"active" = "💡 啟用:{{ .Enable }}\r\n"
|
||||
"enabled" = "🚨 已啟用:{{ .Enable }}\r\n"
|
||||
"online" = "🌐 連線狀態:{{ .Status }}\r\n"
|
||||
"lastOnline" = "🔙 上次上線: {{ .Time }}\r\n"
|
||||
"email" = "📧 郵箱:{{ .Email }}\r\n"
|
||||
"upload" = "🔼 上傳↑:{{ .Upload }}\r\n"
|
||||
"download" = "🔽 下載↓:{{ .Download }}\r\n"
|
||||
@@ -690,7 +691,7 @@
|
||||
"cancel" = "❌ 程序已取消!\n\n您可以隨時使用 /start 重新開始。 🔄"
|
||||
"error_add_client" = "⚠️ 錯誤:\n\n {{ .error }}"
|
||||
"using_default_value" = "好的,我會使用預設值。 😊"
|
||||
"incorrect_input" ="您的輸入無效。\n短語應連續輸入,不能有空格。\n正確示例: aaaaaa\n錯誤示例: aaa aaa 🚫"
|
||||
"incorrect_input" = "您的輸入無效。\n短語應連續輸入,不能有空格。\n正確示例: aaaaaa\n錯誤示例: aaa aaa 🚫"
|
||||
"AreYouSure" = "你確定嗎?🤔"
|
||||
"SuccessResetTraffic" = "📧 電子郵件: {{ .ClientEmail }}\n🏁 結果: ✅ 成功"
|
||||
"FailedResetTraffic" = "📧 電子郵件: {{ .ClientEmail }}\n🏁 結果: ❌ 失敗 \n\n🛠️ 錯誤: [ {{ .ErrorMessage }} ]"
|
||||
|
||||
Reference in New Issue
Block a user