Skip to content

Commit

Permalink
Refactor monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-lashin committed Jul 13, 2022
1 parent f82472b commit 254408a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/cmd/mhub2/cmd/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func AddMonitorCmd() *cobra.Command {
}

newText := func(t string) string {
return fmt.Sprintf("Watching...\n%s\n%s", time.Now().Format(time.Stamp), t)
return fmt.Sprintf("Watching...\n%s%s", time.Now().Format(time.Stamp), t)
}

startMsg, err := bot.Send(tgbotapi.NewMessage(int64(chatId), newText("")))
Expand Down Expand Up @@ -135,7 +135,7 @@ func AddMonitorCmd() *cobra.Command {

for _, v := range vals.GetValidators() {
if v.OperatorAddress == k.ValidatorAddress {
t = fmt.Sprintf("%s\n%s\t%d", t, v.GetMoniker(), response.GetEventNonce())
t = fmt.Sprintf("%s\n%d %s", t, response.GetEventNonce(), v.GetMoniker())
}
}

Expand All @@ -159,7 +159,6 @@ func AddMonitorCmd() *cobra.Command {
continue
}

i++
if i%12 == 0 {
msg := tgbotapi.NewEditMessageText(startMsg.Chat.ID, startMsg.MessageID, newText(t))
msg.ParseMode = "html"
Expand All @@ -168,6 +167,7 @@ func AddMonitorCmd() *cobra.Command {
println(err.Error())
}
}
i++
}

return nil
Expand Down

0 comments on commit 254408a

Please sign in to comment.