Skip to content

Commit

Permalink
fix url for gov proposal button
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonczy committed Apr 25, 2024
1 parent fece5e9 commit c9b0726
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"github.com/ashwanthkumar/slack-go-webhook"
)

const proposalPrefixUrl = "https://explorer.stavr.tech/Composable-Testnet/gov/"
const proposalPrefixTestnetUrl = "https://explorer.stavr.tech/Composable-Testnet/gov/"
const proposalPrefixMainnetUrl = "https://explorer.stavr.tech/Composable-Mainnet/gov/"

func postToSlack(chainId string, proposal Proposal, slackWebookUrl string) error {

Expand All @@ -18,7 +19,12 @@ func postToSlack(chainId string, proposal Proposal, slackWebookUrl string) error
attachment.AddField(slack.Field{Title: "VotingStartTime", Value: proposal.VotingStartTime})
attachment.AddField(slack.Field{Title: "VotingEndTime", Value: proposal.VotingEndTime})

attachment.AddAction(slack.Action{Type: "button", Text: "Open", Url: proposalPrefixUrl + proposal.ID, Style: "primary"})
switch chainId {
case "centauri-1":
attachment.AddAction(slack.Action{Type: "button", Text: "Open", Url: proposalPrefixMainnetUrl + proposal.ID, Style: "primary"})
case "banksy-testnet-5":
attachment.AddAction(slack.Action{Type: "button", Text: "Open", Url: proposalPrefixTestnetUrl + proposal.ID, Style: "primary"})
}

payload := slack.Payload{
Text: "Found new governance proposal",
Expand Down

0 comments on commit c9b0726

Please sign in to comment.