Slack API invalid_block

问题描述 投票:1回答:1

我正在构建一个简单的Slack机器人,并且正在使用checkboxes元素。

[当我从我的API以斜线命令的JSON响应返回以下内容时,出现错误failed with the error "invalid_blocks",但是,当我将其放在block-kit-builder中时,它的工作原理完美(包括“发送到松弛”按钮)

任何想法为什么我运行斜线命令时都会失败-是否有可能从松弛中看到更详细的错误消息?

{
  "blocks": [
    {
      "elements": [
        {
          "style": "primary",
          "text": {
            "emoji": true,
            "text": "Create new TODO list",
            "type": "plain_text"
          },
          "type": "button",
          "value": "value"
        },
        {
          "style": "primary",
          "text": {
            "emoji": true,
            "text": "Help",
            "type": "plain_text"
          },
          "type": "button",
          "value": "value"
        }
      ],
      "type": "actions"
    },
    {
      "text": {
        "text": "Today",
        "type": "mrkdwn"
      },
      "type": "section"
    },
    {
      "elements": [
        {
          "initial_options": [
            {
              "text": {
                "text": "Get Into the garden",
                "type": "mrkdwn"
              },
              "value": "foo"
            }
          ],
          "options": [
            {
              "text": {
                "text": "Get Into the garden",
                "type": "mrkdwn"
              },
              "value": "foo"
            }
          ],
          "type": "checkboxes"
        },
        {
          "style": "primary",
          "text": {
            "emoji": true,
            "text": "Add new Task",
            "type": "plain_text"
          },
          "type": "button",
          "value": "value"
        }
      ],
      "type": "actions"
    }
  ],
  "type": "home"
}
slack-api
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.