fix: resolve shared symbol mapping for token command (#22)
Build Docker Image / build (amd64) (push) Successful in 1m36s

Co-authored-by: thuanle <tl@thuanle.me>
Co-committed-by: thuanle <tl@thuanle.me>
This commit was merged in pull request #22.
This commit is contained in:
2026-04-26 21:13:06 +07:00
committed by claudecode
parent 1486681ef9
commit 72fdb598af
4 changed files with 204 additions and 7 deletions
+7 -4
View File
@@ -6,6 +6,7 @@ import (
"gopkg.in/telebot.v3"
"me.thuanle/bbot/internal/configs/tele"
"me.thuanle/bbot/internal/data"
"me.thuanle/bbot/internal/helper/binancex"
"me.thuanle/bbot/internal/services/tele/chat"
"me.thuanle/bbot/internal/services/tele/view"
)
@@ -75,21 +76,23 @@ func collectRichTokenData(token string) buildRichTokenMessageArgs {
}
}
futureSymbol := token + "USDT"
if data.Market.IsFuturesPair(futureSymbol) {
futureSymbols := binancex.Token2FutureSymbols(token)
for _, futureSymbol := range futureSymbols {
if fp, fr, ft, ok := data.Market.GetFuturePrice(futureSymbol); ok {
a.HasFuture = true
a.FuturePrice = fp
a.FundingRate = fr
a.FundingTimeMs = ft
break
}
}
spotSymbol := token + "USDT"
if data.Market.IsSpotPair(spotSymbol) {
spotSymbols := binancex.Token2SpotSymbols(token)
for _, spotSymbol := range spotSymbols {
if sp, ok := data.Market.GetSpotPrice(spotSymbol); ok {
a.HasSpot = true
a.SpotPrice = sp
break
}
}