From 521e574d5db1706e890a30f899112519d2dc398c Mon Sep 17 00:00:00 2001 From: Kay Date: Wed, 14 Feb 2024 18:18:59 +0000 Subject: [PATCH] chore: enchancing code and make file --- Makefile | 7 ++++++- discord/discord.go | 10 +++++----- engine/run.go | 3 --- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d062028f..cbb0ec56 100644 --- a/Makefile +++ b/Makefile @@ -40,5 +40,10 @@ build: go build -o build/robopac-discord ./cmd/discord go build -o build/robopac-cmd ./cmd/cmd +build-cmd: + go build -o build/robopac-cmd ./cmd/cmd + +build-dc: + go build -o build/robopac-discord ./cmd/discord -.PHONY: build \ No newline at end of file +.PHONY: build diff --git a/discord/discord.go b/discord/discord.go index 38cc3ffe..03b48854 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -73,7 +73,7 @@ func (db *DiscordBot) UpdateStatusInfo() { time.Sleep(time.Second * 5) - err = db.Session.UpdateStatusComplex(newStatus("height", utils.FormatNumber(int64(ns.CurrentBlockHeight)))) + err = db.Session.UpdateStatusComplex(newStatus("total accounts", utils.FormatNumber(int64(ns.TotalAccounts)))) if err != nil { log.Error("can't set status", "err", err) continue @@ -81,8 +81,7 @@ func (db *DiscordBot) UpdateStatusInfo() { time.Sleep(time.Second * 5) - err = db.Session.UpdateStatusComplex(newStatus("circ supply", - utils.FormatNumber(int64(utils.ChangeToCoin(ns.CirculatingSupply)))+"PAC")) + err = db.Session.UpdateStatusComplex(newStatus("height", utils.FormatNumber(int64(ns.CurrentBlockHeight)))) if err != nil { log.Error("can't set status", "err", err) continue @@ -90,7 +89,8 @@ func (db *DiscordBot) UpdateStatusInfo() { time.Sleep(time.Second * 5) - err = db.Session.UpdateStatusComplex(newStatus("total accounts", utils.FormatNumber(int64(ns.TotalAccounts)))) + err = db.Session.UpdateStatusComplex(newStatus("circ supply", + utils.FormatNumber(int64(utils.ChangeToCoin(ns.CirculatingSupply)))+" PAC")) if err != nil { log.Error("can't set status", "err", err) continue @@ -99,7 +99,7 @@ func (db *DiscordBot) UpdateStatusInfo() { time.Sleep(time.Second * 5) err = db.Session.UpdateStatusComplex(newStatus("total power", - utils.FormatNumber(int64(utils.ChangeToCoin(ns.TotalNetworkPower)))+"PAC")) + utils.FormatNumber(int64(utils.ChangeToCoin(ns.TotalNetworkPower)))+" PAC")) if err != nil { log.Error("can't set status", "err", err) continue diff --git a/engine/run.go b/engine/run.go index a4ce6645..34f126ce 100644 --- a/engine/run.go +++ b/engine/run.go @@ -8,7 +8,6 @@ import ( "github.com/kehiy/RoboPac/utils" "github.com/pactus-project/pactus/util" - "github.com/pactus-project/pactus/util/logger" ) const ( @@ -31,8 +30,6 @@ const ( // // The output is always string, but format might be JSON. ??? func (be *BotEngine) Run(input string) (string, error) { - logger.Debug("parse command", "input", input) - cmd, args := be.parseQuery(input) switch cmd {