From f49ea3ae1f145231a91e9e32b8af8cba3df8f744 Mon Sep 17 00:00:00 2001 From: ISSEI <46990203+MosaIssei@users.noreply.github.com> Date: Tue, 28 Mar 2023 09:54:09 +0330 Subject: [PATCH] Update tgbot.go --- web/service/tgbot.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/service/tgbot.go b/web/service/tgbot.go index bc2040da..ea7899e8 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -387,12 +387,18 @@ func (t *Tgbot) getClientUsage(chatId int64, tgUserName string) { } else { total = common.FormatTraffic((traffic.Total)) } - output := fmt.Sprintf("💡 فعال: %t\r\n📧 نام: %s\r\n🔼 میزان آپلود↑: %s\r\n🔽 میزان دانلود↓: %s\r\n🔄 کل: %s / %s\r\n📅 تاریخ انقضاء: %s\r\n", - traffic.Enable, traffic.Email, common.FormatTraffic(traffic.Up), common.FormatTraffic(traffic.Down), common.FormatTraffic((traffic.Up + traffic.Down)), + Enable := "" + if traffic.Enable == "true"{ + Enable = "بله" + } else { + Enable = "خیر" + } + output := fmt.Sprintf("💡 فعال: %t\r\n\n📧 نام: %s\r\n\n🔼 میزان آپلود↑: %s\r\n🔽 میزان دانلود↓: %s\r\n🔄 کل: %s / %s\r\n\n📅 تاریخ انقضاء: %s\r\n", + Enable, traffic.Email, common.FormatTraffic(traffic.Up), common.FormatTraffic(traffic.Down), common.FormatTraffic((traffic.Up + traffic.Down)), total, expiryTime) t.SendMsgToTgbot(chatId, output) } - t.SendAnswer(chatId, "Please choose:", false) + t.SendAnswer(chatId, "یک گزینه را انتخاب کنید:", false) } func (t *Tgbot) searchClient(chatId int64, email string) {