From 9d84e1b73cf1da901e7cf74d67c89fabfd6d32fd Mon Sep 17 00:00:00 2001 From: Kay Date: Wed, 31 Jan 2024 17:54:26 +0000 Subject: [PATCH] fix(discord): updating response messages (#36) --- discord/embeds.go | 11 +++++++++-- discord/handlers.go | 6 +++--- engine/run.go | 6 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/discord/embeds.go b/discord/embeds.go index 26dd8bcb..d6a09f46 100644 --- a/discord/embeds.go +++ b/discord/embeds.go @@ -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", } } diff --git a/discord/handlers.go b/discord/handlers.go index 6f544abf..d426d685 100644 --- a/discord/handlers.go +++ b/discord/handlers.go @@ -2,7 +2,6 @@ package discord import ( "fmt" - "strings" "github.com/bwmarrin/discordgo" "github.com/kehiy/RoboPac/log" @@ -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) diff --git a/engine/run.go b/engine/run.go index 4cc7e692..250cf166 100644 --- a/engine/run.go +++ b/engine/run.go @@ -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: @@ -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: