Skip to content

Commit

Permalink
fix(discord): updating response messages (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy authored Jan 31, 2024
1 parent 7f0d534 commit 9d84e1b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 9 additions & 2 deletions discord/embeds.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ import (

func helpEmbed(s *discordgo.Session) *discordgo.MessageEmbed {
return &discordgo.MessageEmbed{
Title: "RoboPac Help💸",
Title: "RoboPac Help🆘",
URL: "https://pactus.org",
Author: &discordgo.MessageEmbedAuthor{
URL: "https://pactus.org",
IconURL: s.State.User.AvatarURL(""),
Name: s.State.User.Username,
},
Description: "RoboPac is a robot that provides support and information about the Pactus Blockchain.",
Description: "RoboPac is a robot that provides support and information about the Pactus Blockchain.\n" +
"Here is a list of commands supported by RoboPac:\n" +
"```/claim``` Will help you to claim your test-net rewards on main-net.\n" +
"```/claimer-info``` Shows you status of your claim reward.\n" +
"```/node-info``` Shows a node and validator info in network and blockchain.\n" +
"```/network-status``` Shows a brief info about network.\n" +
"```/network-health``` Check and shows network health status.\n" +
"```/bot-wallet``` Shows RoboPac wallet address and balance.\n",
}
}

Expand Down
6 changes: 3 additions & 3 deletions discord/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package discord

import (
"fmt"
"strings"

"github.com/bwmarrin/discordgo"
"github.com/kehiy/RoboPac/log"
Expand Down Expand Up @@ -38,8 +37,9 @@ func claimCommandHandler(db *DiscordBot, s *discordgo.Session, i *discordgo.Inte

log.Info("new claim request", "discordID", i.Member.User.ID, "mainNetAddr", mainnetAddr, "testNetAddr", testnetAddr)

testnetAddr = strings.TrimPrefix(testnetAddr, "testnet-addr:")
mainnetAddr = strings.TrimPrefix(mainnetAddr, "mainnet-addr:")
//! Do we need these two?
// testnetAddr = strings.TrimPrefix(testnetAddr, "testnet-addr:")
// mainnetAddr = strings.TrimPrefix(mainnetAddr, "mainnet-addr:")

command := fmt.Sprintf("claim %s %s %s", i.Member.User.ID, testnetAddr, mainnetAddr)

Expand Down
6 changes: 3 additions & 3 deletions engine/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (be *BotEngine) Run(input string) (string, error) {
status = "UnHealthy❌"
}

return fmt.Sprintf("Network Is: %s\nCurrentTime: %v\nLastBlockTime: %v\nTime Diff: %v\nLast Block Height: %v",
return fmt.Sprintf("Network is %s\nCurrentTime: %v\nLastBlockTime: %v\nTime Diff: %v\nLast Block Height: %v",
status, health.CurrentTime.Format("02/01/2006, 15:04:05"), health.LastBlockTime.Format("02/01/2006, 15:04:05"), health.TimeDifference, health.LastBlockHeight), nil

case CmdNodeInfo:
Expand Down Expand Up @@ -95,9 +95,9 @@ func (be *BotEngine) Run(input string) (string, error) {
return "", err
}

return fmt.Sprintf("NetWork Name: %s\nConnected Peers: %v\n"+
return fmt.Sprintf("Network Name: %s\nConnected Peers: %v\n"+
"Validators Count: %v\nCurrent Block Height: %v\nTotal Power: %v\nTotal Committee Power: %v\n"+
"> Note📝: This info is from one random network node. so, non-blockchain data maybe won't be same every time.",
"> Note📝: This info is from one random network node. Non-blockchain data may not be consistent.",
net.NetworkName, net.ConnectedPeersCount, net.ValidatorsCount, net.CurrentBlockHeight, net.TotalNetworkPower, net.TotalCommitteePower), nil

case CmdBotWallet:
Expand Down

0 comments on commit 9d84e1b

Please sign in to comment.