fix tg bot expiryTime + additions to translations

This commit is contained in:
somebodywashere 2023-05-27 17:23:15 +00:00
parent 2c233dffa5
commit a547530aa2
5 changed files with 8 additions and 5 deletions

View file

@ -701,8 +701,8 @@ func (t *Tgbot) getClientUsage(chatId int64, tgUserName string, tgUserID string)
expiryTime := ""
if traffic.ExpiryTime == 0 {
expiryTime = t.I18nBot("tgbot.unlimited")
} else if traffic.ExpiryTime < 0 {
expiryTime = fmt.Sprintf("%d %s", traffic.ExpiryTime/-86400000, t.I18nBot("tgbot.days"))
} else if (traffic.ExpiryTime/1000 - time.Now().Unix() < 259200) {
expiryTime = fmt.Sprintf("%d %s", traffic.ExpiryTime/3600000, t.I18nBot("tgbot.hours"))
} else {
expiryTime = time.Unix((traffic.ExpiryTime / 1000), 0).Format("2006-01-02 15:04:05")
}

View file

@ -384,6 +384,7 @@
"months" = "Months"
"day" = "Day"
"days" = "Days"
"hours" = "Hours"
"unknown" = "Unknown"
"inbounds" = "Inbounds"
"clients" = "Clients"

View file

@ -384,6 +384,7 @@
"months" = "ماه‌ها"
"day" = "روز"
"days" = "روزها"
"hours" = "ساعت ها"
"unknown" = "نامشخص"
"inbounds" = "ورودی‌ها"
"clients" = "کلاینت‌ها"

View file

@ -428,8 +428,8 @@
"expireIn" = "📅 Окончание через: {{ .Time }}\r\n \r\n"
"active" = "💡 Активен: {{ .Enable }}\r\n"
"email" = "📧 Email: {{ .Email }}\r\n"
"upload" = "🔼 Загрузка↑: {{ .Upload }}\r\n"
"download" = "🔽 Скачивание↓: {{ .Download }}\r\n"
"upload" = "🔼 Исходящий трафик: {{ .Upload }}\r\n"
"download" = "🔽 Входящий трафик: {{ .Download }}\r\n"
"total" = "🔄 Всего: {{ .UpDown }} / {{ .Total }}\r\n"
"TGUser" = "👤 Пользователь Telegram: {{ .TelegramID }}\r\n"
"exhaustedMsg" = "🚨 Исчерпаны {{ .Type }}:\r\n"
@ -437,7 +437,7 @@
"disabled" = "🛑 Отключено: {{ .Disabled }}\r\n"
"depleteSoon" = "🔜 Скоро исчерпание: {{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 Время резервного копирования: {{ .Time }}\r\n"
"refreshedOn" = "🔄🕒 Обновлено: {{ .Time }}\r\n"
"refreshedOn" = "🔄🕒 Данные обновлены: {{ .Time }}\r\n"
[tgbot.buttons]
"closeKeyboard" = "❌ Закрыть клавиатуру"

View file

@ -384,6 +384,7 @@
"months" = "月"
"day" = "天"
"days" = "天"
"hours" = "小时"
"unknown" = "未知"
"inbounds" = "入站连接"
"clients" = "客户端"