From 9b5ace0cc7016f1726888606315ce56771801490 Mon Sep 17 00:00:00 2001 From: somebodywashere <68244480+somebodywashere@users.noreply.github.com> Date: Mon, 25 Dec 2023 22:18:21 +0300 Subject: [PATCH] [tgbot] Fix --- web/service/tgbot.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 29276ff6..5aaa6cc1 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -1419,24 +1419,24 @@ func (t *Tgbot) notifyExhausted() { } else { disabledClients = append(disabledClients, *traffic) } - if len(exhaustedClients) > 0 { - output += t.I18nBot("tgbot.messages.disabled", "Disabled=="+strconv.Itoa(len(disabledClients))) - if len(disabledClients) > 0 { - output += t.I18nBot("tgbot.clients") + ":" - for _, traffic := range disabledClients { - output += " " + traffic.Email - } - output += "\r\n" + } + if len(exhaustedClients) > 0 { + output += t.I18nBot("tgbot.messages.disabled", "Disabled=="+strconv.Itoa(len(disabledClients))) + if len(disabledClients) > 0 { + output += t.I18nBot("tgbot.clients") + ":" + for _, traffic := range disabledClients { + output += " " + traffic.Email } output += "\r\n" - output += t.I18nBot("tgbot.messages.depleteSoon", "Deplete=="+strconv.Itoa(len(exhaustedClients))) - for _, traffic := range exhaustedClients { - output += t.clientInfoMsg(&traffic, true, false, false, true, true, false) - output += "\r\n" - } - t.SendMsgToTgbot(chatID, output) + } + output += "\r\n" + output += t.I18nBot("tgbot.messages.depleteSoon", "Deplete=="+strconv.Itoa(len(exhaustedClients))) + for _, traffic := range exhaustedClients { + output += t.clientInfoMsg(&traffic, true, false, false, true, true, false) + output += "\r\n" } } + t.SendMsgToTgbot(chatID, output) chatIDsDone = append(chatIDsDone, client.TgID) } }