Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2024-01-29 23:06:03 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2024-01-29 23:06:03 +0300
commit78e1194ebb32652908aa5e74dabffba9bdb3307f (patch)
treed210aae7ce756181d1daeaaf005203679eef20d9 /web/service
parente04283c1fb3e56867c7922bab5f3d7edb29fe13c (diff)
bug fix - traffic limit tbbot
Diffstat (limited to 'web/service')
-rw-r--r--web/service/tgbot.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go
index fdb5d312..4ffa7bb4 100644
--- a/web/service/tgbot.go
+++ b/web/service/tgbot.go
@@ -6,9 +6,9 @@ import (
"net"
"net/url"
"os"
+ "slices"
"strconv"
"strings"
- "slices"
"time"
"x-ui/config"
"x-ui/database"
@@ -260,7 +260,7 @@ func (t *Tgbot) answerCommand(message *telego.Message, chatId int64, isAdmin boo
msg += t.I18nBot("tgbot.commands.unknown")
}
- if msg != ""{
+ if msg != "" {
if onlyMessage {
t.SendMsgToTgbot(chatId, msg)
return
@@ -346,7 +346,7 @@ func (t *Tgbot) asnwerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
tu.InlineKeyboardButton("40 GB").WithCallbackData(t.encodeQuery("limit_traffic_c "+email+" 40")),
),
tu.InlineKeyboardRow(
- tu.InlineKeyboardButton("50 GB").WithCallbackData(t.encodeQuery("limit_traffic_c "+email+" 60")),
+ tu.InlineKeyboardButton("50 GB").WithCallbackData(t.encodeQuery("limit_traffic_c "+email+" 50")),
tu.InlineKeyboardButton("60 GB").WithCallbackData(t.encodeQuery("limit_traffic_c "+email+" 60")),
tu.InlineKeyboardButton("80 GB").WithCallbackData(t.encodeQuery("limit_traffic_c "+email+" 80")),
),
@@ -1022,7 +1022,7 @@ func (t *Tgbot) getInboundUsages() string {
}
func (t *Tgbot) clientInfoMsg(traffic *xray.ClientTraffic, printEnabled bool, printOnline bool, printActive bool,
- printDate bool, printTraffic bool, printRefreshed bool) string {
+ printDate bool, printTraffic bool, printRefreshed bool) string {
now := time.Now().Unix()
expiryTime := ""
@@ -1380,7 +1380,6 @@ func (t *Tgbot) getExhausted(chatId int64) {
output += t.I18nBot("tgbot.messages.exhaustedCount", "Type=="+t.I18nBot("tgbot.clients"))
output += t.I18nBot("tgbot.messages.disabled", "Disabled=="+strconv.Itoa(len(disabledClients)))
output += t.I18nBot("tgbot.messages.depleteSoon", "Deplete=="+strconv.Itoa(exhaustedCC))
-
if exhaustedCC > 0 {
output += t.I18nBot("tgbot.messages.depleteSoon", "Deplete=="+t.I18nBot("tgbot.clients"))
@@ -1490,7 +1489,6 @@ func (t *Tgbot) onlineClients(chatId int64, messageID ...int) {
output := t.I18nBot("tgbot.messages.onlinesCount", "Count=="+fmt.Sprint(onlinesCount))
keyboard := tu.InlineKeyboard(tu.InlineKeyboardRow(
tu.InlineKeyboardButton(t.I18nBot("tgbot.buttons.refresh")).WithCallbackData(t.encodeQuery("onlines_refresh"))))
-
if onlinesCount > 0 {
var buttons []telego.InlineKeyboardButton