From 59da49c17f87c9eddf36a9470f494a434b836133 Mon Sep 17 00:00:00 2001 From: thuanle Date: Sun, 26 Apr 2026 15:14:39 +0700 Subject: [PATCH] Remove ETH special portfolio tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Treat ETH like any other token β€” display only spot/future price and funding rate, removing personal portfolio calculations. Co-Authored-By: Claude Opus 4.7 --- internal/services/tele/commands/token.go | 51 ------------------------ 1 file changed, 51 deletions(-) diff --git a/internal/services/tele/commands/token.go b/internal/services/tele/commands/token.go index 77f6f57..0c93d14 100644 --- a/internal/services/tele/commands/token.go +++ b/internal/services/tele/commands/token.go @@ -3,8 +3,6 @@ package commands import ( "strings" - "golang.org/x/text/language" - "golang.org/x/text/message" "gopkg.in/telebot.v3" "me.thuanle/bbot/internal/configs/tele" "me.thuanle/bbot/internal/data" @@ -13,8 +11,6 @@ import ( "me.thuanle/bbot/internal/services/tele/view" ) -var lastEthPrice float64 - func showStickerMode(context telebot.Context, token string) { token = strings.ToUpper(token) stickerIdx, ok := tele.Token2StickerIdxMap[token] @@ -60,53 +56,6 @@ func OnTokenInfoByToken(context telebot.Context, token string) error { sp, _ := data.Market.GetSpotPrice(sSymbol) _ = chat.ReplyMessage(context, view.RenderOnPriceMessage(symbols[0], sp, fp, fundRate, fundTime, tokenInterestRate)) - if strings.ToUpper(token) == "ETH" { - mFmt := message.NewPrinter(language.AmericanEnglish) - realAmount := 35. - trangBucAmount := 14. - basePrice := 2500.0 - baseTotal := realAmount * basePrice - trangBucTotal := trangBucAmount * basePrice - realCurTotal := realAmount * sp - trangBucCurTotal := trangBucAmount * sp - - lastDelta := "" - if lastEthPrice == 0 { - lastEthPrice = sp - } else { - lastDelta = mFmt.Sprintf( - "Ξ” price: $%+.0f\n"+ - "Ξ” Usdt: $%+.0f\n", - sp-lastEthPrice, - (sp-lastEthPrice)*realAmount, - ) - lastEthPrice = sp - } - - msg := mFmt.Sprintf( - "πŸŽ‰πŸŽŠπŸŽŠπŸ¦ˆπŸ¦ˆπŸ¦ˆ @th13vn Real πŸ¦ˆπŸ¦ˆπŸ¦ˆπŸŽŠπŸŽŠπŸŽ‰\n"+ - "βˆ‘ USDT: $%.0f\n"+ - "Lợi nhuαΊ­n: $%.0f\n"+ - "%s\n"+ - "\n"+ - "πŸš€πŸš€πŸš€πŸš€πŸš€ Road to 5k πŸš€πŸš€πŸš€πŸš€πŸš€: \n"+ - "- Ξ” Price: $%0.0f\n"+ - "- Ξ” Vol: $%0.0f\n"+ - "\n"+ - "πŸ’ΈπŸ’ΈπŸ’ΈπŸ’ΈπŸ’Έ Trang Bα»©c balance πŸ’ΈπŸ’ΈπŸ’ΈπŸ’ΈπŸ’Έ\n"+ - "βˆ‘ USDT: $%.0f\n"+ - "Lợi nhuαΊ­n: $%.0f\n", - realCurTotal, - realCurTotal-baseTotal, - lastDelta, - 5000-sp, - 5000*realAmount-realCurTotal, - trangBucCurTotal, - trangBucCurTotal-trangBucTotal, - ) - - _ = chat.ReplyMessage(context, msg) - } return nil } -- 2.52.0