From a624f2640d93fd542e931cc072441206fc663a00 Mon Sep 17 00:00:00 2001 From: somebodywashere <68244480+somebodywashere@users.noreply.github.com> Date: Sat, 27 May 2023 18:34:35 +0000 Subject: [PATCH] fix tg bot + translations --- web/service/tgbot.go | 2 +- web/translation/translate.ru_RU.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 6e2e7556..9cf536ee 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -702,7 +702,7 @@ func (t *Tgbot) getClientUsage(chatId int64, tgUserName string, tgUserID string) if traffic.ExpiryTime == 0 { expiryTime = t.I18nBot("tgbot.unlimited") } else if (traffic.ExpiryTime/1000 - time.Now().Unix() < 259200) { - expiryTime = fmt.Sprintf("%d %s", traffic.ExpiryTime/3600000, t.I18nBot("tgbot.hours")) + expiryTime = fmt.Sprintf("%d %s", (traffic.ExpiryTime/1000 - time.Now().Unix())/3600, t.I18nBot("tgbot.hours")) } else { expiryTime = time.Unix((traffic.ExpiryTime / 1000), 0).Format("2006-01-02 15:04:05") } diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index bd927ba6..17779f39 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -384,6 +384,7 @@ "months" = "Месяцев" "day" = "День" "days" = "Дней" +"hours" = Часов "unknown" = "Неизвестно" "inbounds" = "Входящие" "clients" = "Клиенты"