feat: Add remaining time to tgbot #3355

This commit is contained in:
Incognito-Coder 2025-08-13 23:20:54 +03:30
parent 3d0212c21d
commit 871c7a1d3d
14 changed files with 117 additions and 88 deletions

View file

@ -2171,6 +2171,22 @@ func (t *Tgbot) clientInfoMsg(
expiryTime = t.I18nBot("tgbot.unlimited")
} else if diff > 172800 || !traffic.Enable {
expiryTime = time.Unix((traffic.ExpiryTime / 1000), 0).Format("2006-01-02 15:04:05")
if diff > 0 {
days := diff / 86400
hours := (diff % 86400) / 3600
minutes := (diff % 3600) / 60
remainingTime := ""
if days > 0 {
remainingTime += fmt.Sprintf("%d %s ", days, t.I18nBot("tgbot.days"))
}
if hours > 0 {
remainingTime += fmt.Sprintf("%d %s ", hours, t.I18nBot("tgbot.hours"))
}
if minutes > 0 {
remainingTime += fmt.Sprintf("%d %s", minutes, t.I18nBot("tgbot.minutes"))
}
expiryTime += fmt.Sprintf(" (%s)", remainingTime)
}
} else if traffic.ExpiryTime < 0 {
expiryTime = fmt.Sprintf("%d %s", traffic.ExpiryTime/-86400000, t.I18nBot("tgbot.days"))
flag = true

View file

@ -561,24 +561,25 @@
"resetOutboundTrafficError" = "خطأ في إعادة تعيين حركات المرور الصادرة"
[tgbot]
"keyboardClosed" = "❌ الكيبورد المخصص اتقفلت!"
"noResult" = "❗ مفيش نتيجة!"
"noQuery" = "❌ مش لاقي السؤال! استخدم الأمر تاني!"
"wentWrong" = "❌ حصل خطأ!"
"noIpRecord" = "❗ مفيش سجل IP!"
"noInbounds" = "❗ مفيش إدخال متواجد!"
"unlimited" = "♾ غير محدود (إعادة ضبط)"
"add" = "أضف"
"keyboardClosed" = "❌ لوحة المفاتيح مغلقة!"
"noResult" = "❗ لا يوجد نتائج!"
"noQuery" = "❌ لم يتم العثور على الاستعلام! يرجى استخدام الأمر مرة أخرى!"
"wentWrong" = "❌ حدث خطأ ما!"
"noIpRecord" = "❗ لا يوجد سجل IP!"
"noInbounds" = "❗ لم يتم العثور على أي وارد!"
"unlimited" = "♾ غير محدود (إعادة تعيين)"
"add" = "إضافة"
"month" = "شهر"
"months" = "شهور"
"months" = "أشهر"
"day" = "يوم"
"days" = "أيام"
"hours" = "ساعات"
"unknown" = "مش معروف"
"inbounds" = "الإدخالات"
"minutes" = "دقائق"
"unknown" = "غير معروف"
"inbounds" = "الواردات"
"clients" = "العملاء"
"offline" = "🔴 أوفلاين"
"online" = "🟢 أونلاين"
"offline" = "🔴 غير متصل"
"online" = "🟢 متصل"
[tgbot.commands]
"unknown" = "❗ أمر مش معروف."

View file

@ -574,6 +574,7 @@
"day" = "Day"
"days" = "Days"
"hours" = "Hours"
"minutes" = "Minutes"
"unknown" = "Unknown"
"inbounds" = "Inbounds"
"clients" = "Clients"

View file

@ -91,7 +91,7 @@
"invalidFormData" = "El formato de los datos de entrada es inválido."
"emptyUsername" = "Por favor ingresa el nombre de usuario."
"emptyPassword" = "Por favor ingresa la contraseña."
"wrongUsernameOrPassword" = "Nombre de usuario, contraseña o código de dos factores incorrecto."
"wrongUsernameOrPassword" = "Nombre de usuario, contraseña o código de dos factores incorrecto."
"successLogin" = "Has iniciado sesión en tu cuenta correctamente."
[pages.index]
@ -535,9 +535,9 @@
[pages.settings.security]
"admin" = "Credenciales de administrador"
"twoFactor" = "Autenticación de dos factores"
"twoFactorEnable" = "Habilitar 2FA"
"twoFactorEnableDesc" = "Añade una capa adicional de autenticación para mayor seguridad."
"twoFactor" = "Autenticación de dos factores"
"twoFactorEnable" = "Habilitar 2FA"
"twoFactorEnableDesc" = "Añade una capa adicional de autenticación para mayor seguridad."
"twoFactorModalSetTitle" = "Activar autenticación de dos factores"
"twoFactorModalDeleteTitle" = "Desactivar autenticación de dos factores"
"twoFactorModalSteps" = "Para configurar la autenticación de dos factores, sigue estos pasos:"
@ -561,23 +561,24 @@
"resetOutboundTrafficError" = "Error al reiniciar el tráfico saliente"
[tgbot]
"keyboardClosed" = "❌ ¡Teclado personalizado cerrado!"
"noResult" = "❗ ¡Sin resultados!"
"noQuery" = "❌ ¡Consulta no encontrada! ¡Por favor utiliza el comando nuevamente!"
"keyboardClosed" = "❌ Teclado cerrado!"
"noResult" = "❗ ¡No hay resultados!"
"noQuery" = "❌ ¡Consulta no encontrada! ¡Por favor, use el comando de nuevo!"
"wentWrong" = "❌ ¡Algo salió mal!"
"noIpRecord" = "❗ ¡Sin Registro de IP!"
"noIpRecord" = "❗ ¡No hay registro de IP!"
"noInbounds" = "❗ ¡No se encontraron entradas!"
"unlimited" = "♾ Ilimitado"
"add" = "Agregar"
"unlimited" = "♾ Ilimitado (Restablecer)"
"add" = "Añadir"
"month" = "Mes"
"months" = "Meses"
"day" = "Día"
"days" = "Días"
"hours" = "Horas"
"minutes" = "Minutos"
"unknown" = "Desconocido"
"inbounds" = "Entradas"
"clients" = "Clientes"
"offline" = "🔴 Sin conexión"
"offline" = "🔴 Desconectado"
"online" = "🟢 En línea"
[tgbot.commands]

View file

@ -561,22 +561,23 @@
"resetOutboundTrafficError" = "خطا در بازنشانی ترافیک خروجی"
[tgbot]
"keyboardClosed" = "❌ کیبورد سفارشی بسته شد!"
"noResult" = "❗ نتیجهای یافت نشد!"
"noQuery" = "❌ کوئری یافت نشد! لطفاً دستور را مجدداً استفاده کنید!"
"wentWrong" = "❌ مشکلی رخ داده است!"
"noIpRecord" = "❗ رکورد IP یافت نشد!"
"keyboardClosed" = "❌ صفحه کلید بسته شد!"
"noResult" = "❗ نتیجه ای یافت نشد!"
"noQuery" = "❌ درخواست یافت نشد! لطفا دوباره تلاش کنید!"
"wentWrong" = "❌ مشکلی پیش آمد!"
"noIpRecord" = "❗ رکورد آی پی وجود ندارد!"
"noInbounds" = "❗ هیچ ورودی یافت نشد!"
"unlimited" = "♾ - نامحدود(ریست)"
"add" = "اضافه کردن"
"unlimited" = "♾ نامحدود(ریست)"
"add" = "افزودن"
"month" = "ماه"
"months" = "ماه"
"months" = "ماه"
"day" = "روز"
"days" = "روز"
"hours" = "ساعت‌"
"hours" = "ساعت"
"minutes" = "دقیقه"
"unknown" = "نامشخص"
"inbounds" = "ورودیها"
"clients" = لاینت‌ها"
"inbounds" = "ورودی ها"
"clients" = اربران"
"offline" = "🔴 آفلاین"
"online" = "🟢 آنلاین"

View file

@ -561,21 +561,22 @@
"resetOutboundTrafficError" = "Gagal mereset lalu lintas keluar"
[tgbot]
"keyboardClosed" = "❌ Papan ketik kustom ditutup!"
"keyboardClosed" = "❌ Keyboard ditutup!"
"noResult" = "❗ Tidak ada hasil!"
"noQuery" = "❌ Permintaan tidak ditemukan! Harap gunakan perintah lagi!"
"wentWrong" = "❌ Ada yang salah!"
"noQuery" = "❌ Kueri tidak ditemukan! Silakan gunakan perintah lagi!"
"wentWrong" = "❌ Terjadi kesalahan!"
"noIpRecord" = "❗ Tidak ada Catatan IP!"
"noInbounds" = "❗ Tidak ada masuk ditemukan!"
"unlimited" = "♾ Tak terbatas"
"noInbounds" = "❗ Tidak ada inbound yang ditemukan!"
"unlimited" = "♾ Tidak terbatas (Reset)"
"add" = "Tambah"
"month" = "Bulan"
"months" = "Bulan"
"day" = "Hari"
"days" = "Hari"
"hours" = "Jam"
"minutes" = "Menit"
"unknown" = "Tidak diketahui"
"inbounds" = "Masuk"
"inbounds" = "Inbound"
"clients" = "Klien"
"offline" = "🔴 Offline"
"online" = "🟢 Online"

View file

@ -561,21 +561,22 @@
"resetOutboundTrafficError" = "送信トラフィックのリセットエラー"
[tgbot]
"keyboardClosed" = "❌ カスタムキーボードが閉じられました!"
"keyboardClosed" = "❌ キーボードを閉じました!"
"noResult" = "❗ 結果がありません!"
"noQuery" = "❌ クエリが見つかりませんでした!もう一度コマンドを使用してください!"
"wentWrong" = "❌ 問題が発生しました!"
"noIpRecord" = "❗ IP記録がありません!"
"noInbounds" = "❗ インバウンド接続が見つかりません!"
"unlimited" = "♾ 無制限"
"noQuery" = "❌ クエリが見つかりません!コマンドを再利用してください!"
"wentWrong" = "❌ 何かがうまくいかなかった!"
"noIpRecord" = "❗ IPレコードがありません!"
"noInbounds" = "❗ インバウンドが見つかりません!"
"unlimited" = "♾ 無制限(リセット)"
"add" = "追加"
"month" = "月"
"months" = "月"
"months" = "月"
"day" = "日"
"days" = "日"
"days" = "日"
"hours" = "時間"
"minutes" = "分"
"unknown" = "不明"
"inbounds" = "インバウンド接続"
"inbounds" = "インバウンド"
"clients" = "クライアント"
"offline" = "🔴 オフライン"
"online" = "🟢 オンライン"

View file

@ -561,21 +561,22 @@
"resetOutboundTrafficError" = "Erro ao redefinir tráfego de saída"
[tgbot]
"keyboardClosed" = "❌ Teclado personalizado fechado!"
"keyboardClosed" = "❌ Teclado fechado!"
"noResult" = "❗ Nenhum resultado!"
"noQuery" = "❌ Consulta não encontrada! Por favor, use o comando novamente!"
"wentWrong" = "❌ Algo deu errado!"
"noIpRecord" = "❗ Nenhum registro de IP!"
"noInbounds" = "❗ Nenhuma entrada encontrada!"
"unlimited" = "♾ Ilimitado (Reiniciar)"
"noInbounds" = "❗ Nenhum inbound encontrado!"
"unlimited" = "♾ Ilimitado (Reset)"
"add" = "Adicionar"
"month" = "Mês"
"months" = "Meses"
"day" = "Dia"
"days" = "Dias"
"hours" = "Horas"
"minutes" = "Minutos"
"unknown" = "Desconhecido"
"inbounds" = "Entradas"
"inbounds" = "Inbounds"
"clients" = "Clientes"
"offline" = "🔴 Offline"
"online" = "🟢 Online"

View file

@ -574,6 +574,7 @@
"day" = "День"
"days" = "Дней"
"hours" = "Часов"
"minutes" = "Минуты"
"unknown" = "Неизвестно"
"inbounds" = "Инбаунды"
"clients" = "Клиенты"

View file

@ -561,22 +561,23 @@
"resetOutboundTrafficError" = "Giden trafik sıfırlanırken hata"
[tgbot]
"keyboardClosed" = "❌ Özel klavye kapalı!"
"keyboardClosed" = "❌ Klavye kapatıldı!"
"noResult" = "❗ Sonuç yok!"
"noQuery" = "❌ Sorgu bulunamadı! Lütfen komutu tekrar kullanın!"
"wentWrong" = "❌ Bir şeyler yanlış gitti!"
"noIpRecord" = "❗ IP Kaydı yok!"
"noInbounds" = "❗ Gelen bulunamadı!"
"unlimited" = "♾ Sınırsız(Sıfırla)"
"noIpRecord" = "❗ IP Kaydı Yok!"
"noInbounds" = "❗ Gelen bağlantı bulunamadı!"
"unlimited" = "♾ Sınırsız (Sıfırla)"
"add" = "Ekle"
"month" = "Ay"
"months" = "Aylar"
"day" = "Gün"
"days" = "Günler"
"hours" = "Saatler"
"unknown" = "Bilinmiyor"
"minutes" = "Dakika"
"unknown" = "Bilinmeyen"
"inbounds" = "Gelenler"
"clients" = "Müşteriler"
"clients" = "İstemciler"
"offline" = "🔴 Çevrimdışı"
"online" = "🟢 Çevrimiçi"

View file

@ -561,19 +561,20 @@
"resetOutboundTrafficError" = "Помилка скидання вихідного трафіку"
[tgbot]
"keyboardClosed" = "❌ Спеціальна клавіатура закрита!"
"keyboardClosed" = "❌ Клавіатуру закрито!"
"noResult" = "❗ Немає результату!"
"noQuery" = "❌ Запит не знайдено! Скористайтеся командою ще раз!"
"noQuery" = "❌ Запит не знайдено! Будь ласка, використовуйте команду ще раз!"
"wentWrong" = "❌ Щось пішло не так!"
"noIpRecord" = "❗ Немає IP-запису!"
"noInbounds" = "❗ Вхідних не знайдено!"
"unlimited" = "♾ Необмежений (скинути)"
"noIpRecord" = "❗ Немає запису IP!"
"noInbounds" = "❗ Вхідні не знайдені!"
"unlimited" = "♾ Необмежено (Скинути)"
"add" = "Додати"
"month" = "Місяць"
"months" = "Місяці"
"day" = "День"
"days" = "Дні"
"hours" = "Годинник"
"hours" = "Години"
"minutes" = "Хвилини"
"unknown" = "Невідомо"
"inbounds" = "Вхідні"
"clients" = "Клієнти"

View file

@ -91,7 +91,7 @@
"invalidFormData" = "Dạng dữ liệu nhập không hợp lệ."
"emptyUsername" = "Vui lòng nhập tên người dùng."
"emptyPassword" = "Vui lòng nhập mật khẩu."
"wrongUsernameOrPassword" = "Tên người dùng, mật khẩu hoặc mã xác thực hai yếu tố không hợp lệ."
"wrongUsernameOrPassword" = "Tên người dùng, mật khẩu hoặc mã xác thực hai yếu tố không hợp lệ."
"successLogin" = "Bạn đã đăng nhập vào tài khoản thành công."
[pages.index]
@ -535,9 +535,9 @@
[pages.settings.security]
"admin" = "Thông tin đăng nhập quản trị viên"
"twoFactor" = "Xác thực hai yếu tố"
"twoFactorEnable" = "Bật 2FA"
"twoFactorEnableDesc" = "Thêm một lớp bảo mật bổ sung để tăng cường an toàn."
"twoFactor" = "Xác thực hai yếu tố"
"twoFactorEnable" = "Bật 2FA"
"twoFactorEnableDesc" = "Thêm một lớp bảo mật bổ sung để tăng cường an toàn."
"twoFactorModalSetTitle" = "Bật xác thực hai yếu tố"
"twoFactorModalDeleteTitle" = "Tắt xác thực hai yếu tố"
"twoFactorModalSteps" = "Để thiết lập xác thực hai yếu tố, hãy thực hiện các bước sau:"
@ -561,22 +561,23 @@
"resetOutboundTrafficError" = "Lỗi khi đặt lại lưu lượng truy cập đi"
[tgbot]
"keyboardClosed" = "❌ Bàn phím tùy chỉnh đã đóng!"
"keyboardClosed" = "❌ Bàn phím đã đóng!"
"noResult" = "❗ Không có kết quả!"
"noQuery" = "❌ Không tìm thấy truy vấn! Vui lòng sử dụng lệnh lại!"
"noQuery" = "❌ Không tìm thấy truy vấn! Vui lòng sử dụng lại lệnh!"
"wentWrong" = "❌ Đã xảy ra lỗi!"
"noIpRecord" = "❗ Không có bản ghi IP!"
"noInbounds" = "❗ Không tìm thấy inbound!"
"unlimited" = "♾ Không giới hạn"
"unlimited" = "♾ Không giới hạn (Đặt lại)"
"add" = "Thêm"
"month" = "Tháng"
"months" = "Tháng"
"day" = "Ngày"
"days" = "Ngày"
"hours" = "Giờ"
"unknown" = "Không rõ"
"inbounds" = "Vào"
"clients" = "Các người dùng"
"minutes" = "Phút"
"unknown" = "Không xác định"
"inbounds" = "Inbound"
"clients" = "Client"
"offline" = "🔴 Ngoại tuyến"
"online" = "🟢 Trực tuyến"

View file

@ -563,19 +563,20 @@
[tgbot]
"keyboardClosed" = "❌ 自定义键盘已关闭!"
"noResult" = "❗ 没有结果!"
"noQuery" = "❌ 未找到查询!请重新使用命令!"
"noQuery" = "❌ 未找到查询!请再次使用该命令!"
"wentWrong" = "❌ 出了点问题!"
"noIpRecord" = "❗ 没有 IP 记录!"
"noInbounds" = "❗ 没有找到入站连接"
"unlimited" = "♾ 无限"
"noIpRecord" = "❗ 没有IP记录"
"noInbounds" = "❗ 未找到入站"
"unlimited" = "♾ 无限(重置)"
"add" = "添加"
"month" = "月"
"months" = "月"
"day" = "天"
"days" = "天"
"hours" = "小时"
"minutes" = "分钟"
"unknown" = "未知"
"inbounds" = "入站连接"
"inbounds" = "入站"
"clients" = "客户端"
"offline" = "🔴 离线"
"online" = "🟢 在线"

View file

@ -563,22 +563,23 @@
[tgbot]
"keyboardClosed" = "❌ 自定義鍵盤已關閉!"
"noResult" = "❗ 沒有結果!"
"noQuery" = "❌ 未找到查詢!請重新使用命令!"
"noQuery" = "❌ 未找到查詢!請再次使用該命令!"
"wentWrong" = "❌ 出了點問題!"
"noIpRecord" = "❗ 沒有 IP 記錄!"
"noInbounds" = "❗ 沒有找到入站連線"
"unlimited" = "♾ 無限"
"add" = "新增"
"noIpRecord" = "❗ 沒有IP記錄"
"noInbounds" = "❗ 未找到入站"
"unlimited" = "♾ 無限(重置)"
"add" = "添加"
"month" = "月"
"months" = "月"
"day" = "天"
"days" = "天"
"hours" = "小時"
"minutes" = "分鐘"
"unknown" = "未知"
"inbounds" = "入站連線"
"inbounds" = "入站"
"clients" = "客戶端"
"offline" = "🔴 離線"
"online" = "🟢 "
"online" = "🟢 線"
[tgbot.commands]
"unknown" = "❗ 未知命令"