diff options
| author | Roman Gogolev <roman.gogolev@gmail.com> | 2025-12-03 16:58:54 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-03 16:58:54 +0300 |
| commit | 83a1c721c761b82c719a51870e78f24d50f3a028 (patch) | |
| tree | 7290c9381c82d2939ee7bc42a9aa9e39a9acee91 | |
| parent | 7ccc0877a152c35ef6933e3e3e998d91a212ad26 (diff) | |
Fix int64 for 32-bit arch (#3591)
* fix int64 for 32-bit arch
* Update web/service/tgbot.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| -rw-r--r-- | web/service/tgbot.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go index cac49dd9..06c51faa 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -210,7 +210,7 @@ func (t *Tgbot) Start(i18nFS embed.FS) error { // Parse admin IDs from comma-separated string if tgBotID != "" { for _, adminID := range strings.Split(tgBotID, ",") { - id, err := strconv.Atoi(adminID) + id, err := strconv.ParseInt(adminID, 10, 64) if err != nil { logger.Warning("Failed to parse admin ID from Telegram bot chat ID:", err) return err @@ -905,8 +905,8 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.errorOperation")) t.searchClient(chatId, email, callbackQuery.Message.GetMessageID()) case "add_client_limit_traffic_c": - limitTraffic, _ := strconv.Atoi(dataArray[1]) - client_TotalGB = int64(limitTraffic) * 1024 * 1024 * 1024 + limitTraffic, _ := strconv.ParseInt(dataArray[1], 10, 64) + client_TotalGB = limitTraffic * 1024 * 1024 * 1024 messageId := callbackQuery.Message.GetMessageID() inbound, err := t.inboundService.GetInbound(receiver_inbound_ID) if err != nil { @@ -1010,7 +1010,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool t.editMessageCallbackTgBot(chatId, callbackQuery.Message.GetMessageID(), inlineKeyboard) case "reset_exp_c": if len(dataArray) == 3 { - days, err := strconv.Atoi(dataArray[2]) + days, err := strconv.ParseInt(dataArray[2], 10, 64) if err == nil { var date int64 if days > 0 { @@ -1115,7 +1115,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool t.searchClient(chatId, email, callbackQuery.Message.GetMessageID()) case "add_client_reset_exp_c": client_ExpiryTime = 0 - days, _ := strconv.Atoi(dataArray[1]) + days, _ := strconv.ParseInt(dataArray[1], 10, 64) var date int64 if client_ExpiryTime > 0 { if client_ExpiryTime-time.Now().Unix()*1000 < 0 { |
