slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.65k stars 1.13k forks source link

I think the button element is missing a URL field #1085

Closed sudermanjr closed 2 years ago

sudermanjr commented 2 years ago

From the block kit, I can generate:

        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "This is a section block with a button."
            },
            "accessory": {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "text": "Click Me",
                    "emoji": true
                },
                "value": "click_me_123",
                "url": "https://google.com",
                "action_id": "button-action"
            }
        },

That button accessory has a url, which I can't seem to add to that button. Maybe I'm missing something?

github.com/slack-go/slack v0.10.3
sudermanjr commented 2 years ago

Actually, I was wrong. The field exists, it's just not available in the New helper function.

pthieu commented 1 year ago

@sudermanjr can you show what your final solution came to be?

sudermanjr commented 1 year ago

This was a while ago, but I am pretty sure I had to construct the block myself, rather than using the helper function.

joshbranham commented 7 months ago

Implemented a fix on #1250