在 Slack 中通过 callback_id 没有附件

Pass callback_id without attachments in Slack

我正在使用 Slack Api 发送消息。
所以,我收到了这条阻止消息:

{
    "blocks": [
        {
            "type": "divider"
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "Do you have access ?"
            }
        },
        {
            "type": "actions",
            "elements": [
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "emoji": true,
                        "text": "Yes"
                    },
                    "style": "primary",
                    "value": "click_me_123"
                },
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "emoji": true,
                        "text": "Skip"
                    },
                    "style": "danger",
                    "value": "click_me_123"
                }
            ]
        }
    ]
}

如您所见,这是块邮件,没有任何附件。因此,当单击“是”或“否”按钮时它不会发送任何 callback_id。但是当单击“是”或“否”按钮时我需要发送 callback_id。该怎么做?
或者另一个黑客。无论如何要删除附件的左边框?
谢谢

我假设您正在寻找一种方法让您的代码在按下按钮时解析选项。您需要分配可以解析并确定选择的唯一值。像

    {
        "type": "actions",
        "elements": [
            {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "emoji": true,
                    "text": "Yes"
                },
                "style": "primary",
                "value": "yes"
            },
            {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "emoji": true,
                    "text": "Skip"
                },
                "style": "danger",
                "value": "skip"
            }
        ]
    }