Skip to content

Commit

Permalink
chore: enchancing code and make file
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Feb 14, 2024
1 parent 28961a8 commit 521e574
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
.PHONY: build
10 changes: 5 additions & 5 deletions discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@ 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
}

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
}

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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions engine/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/kehiy/RoboPac/utils"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/logger"
)

const (
Expand All @@ -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 {
Expand Down

0 comments on commit 521e574

Please sign in to comment.