slack
slack copied to clipboard
Can you add button confirm
https://github.com/slack-go/slack/blob/792f7ed7aeae758f493239a9c50bb5d18eefc46e/block_element.go#L171
Please give more details.
Confirmation buttons are supported, unless you're asking about something different? This example code works in our apps home page and pops open a confirmation Modal once a user hits the "Submit" button.
approveReqButton := slack.ButtonBlockElement{
Type: slack.METButton,
Text: &slack.TextBlockObject{
Type: slack.PlainTextType,
Text: "Submit",
},
ActionID: actionIDUserSubmitted,
Value: formattedValue,
Style: slack.StylePrimary,
Confirm: slack.NewConfirmationBlockObject(
&slack.TextBlockObject{
Type: slack.PlainTextType,
Text: "Confirm Submit",
},
&slack.TextBlockObject{
Type: slack.PlainTextType,
Text: "Are you sure you want to submit?",
},
&slack.TextBlockObject{
Type: slack.PlainTextType,
Text: "Yes",
},
&slack.TextBlockObject{
Type: slack.PlainTextType,
Text: "No, take me back",
}),
}