Merge branch 'main' into chore/remove-eth-special-case
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"gopkg.in/telebot.v3"
|
||||
"me.thuanle/bbot/internal/configs/key"
|
||||
"me.thuanle/bbot/internal/data"
|
||||
"me.thuanle/bbot/internal/services/controllers"
|
||||
"me.thuanle/bbot/internal/services/tele/chat"
|
||||
"me.thuanle/bbot/internal/services/tele/view"
|
||||
@@ -16,3 +21,14 @@ func OnGetTopFundingFee(context telebot.Context) error {
|
||||
fee, float64s, cds := controllers.GetTopFundingFee()
|
||||
return chat.ReplyMessagePre(context, view.RenderOnGetTopFundingFeeMessage(fee, float64s, cds))
|
||||
}
|
||||
|
||||
func OnRefreshPairCache(context telebot.Context) error {
|
||||
adminID, err := strconv.ParseInt(os.Getenv(key.AdminChatID), 10, 64)
|
||||
if err != nil || adminID == 0 || context.Sender().ID != adminID {
|
||||
return nil
|
||||
}
|
||||
if err := data.Market.RefreshTradingPairCache(); err != nil {
|
||||
return chat.ReplyMessage(context, "Failed to refresh trading pair cache")
|
||||
}
|
||||
return chat.ReplyMessage(context, "Trading pair cache refreshed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user