Microsoft Bot Framework Composer - 发送 Slack Block Kit

Microsoft Bot Framework Composer - Send Slack Block Kit

使用 Microsoft Bot Framework Composer,我想使用 Block Kit 向 Slack 通道发送响应。我尝试创建一个带有 JSON 附件的回复,但是机器人 returns:

The bot encountered an error or bug. To continue to run this bot, please fix the bot source code.

# SendActivity_pTmt7x()
[Activity
    Attachments = ${json(SendActivity_pTmt7x_attachment_R1WWzr())}
]

# SendActivity_pTmt7x_attachment_R1WWzr()
> To learn more about the LG file format, read the documentation at
> https://aka.ms/lg-file-format
- ${SlackMessage()}

# SlackMessage()

- # slackmessage
- ```

{

"type": "Attachment",
"name": "blocks",
  "content": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "This is a sample Slack Block Kit"
      }
    },
    {
      "type": "divider"
    }
  ]
}

是否可以构建一个可以在 Slack 中正确呈现 Block Kit UI 的 Response?

Slack 适配器配置不正确。我在 Azure Bot 配置中禁用了 Slack 通道并在 Composer 中设置了 Slack Adapter。

# slackmessage()`enter code here`

- '''
{
    "type" : "Attachment",

    "name": "blocks",
    "content":
[
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "Hello, Assistant to the Regional Manager Dwight! *Michael Scott* wants to know where you'd like to take the Paper Company investors to dinner tonight.\n\n *Please select a restaurant:*"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*Farmhouse Thai Cuisine*\n:star::star::star::star: 1528 reviews\n They do have some vegan options, like the roti and curry, plus they have a ton of salad stuff and noodles can be ordered without meat!! They have something for everyone here"
            },
            "accessory": {
                "type": "image",
                "image_url": "https://s3-media3.fl.yelpcdn.com/bphoto/c7ed05m9lC2EmA3Aruue7A/o.jpg",
                "alt_text": "alt text for image"
            }
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*Kin Khao*\n:star::star::star::star: 1638 reviews\n The sticky rice also goes wonderfully with the caramelized pork belly, which is absolutely melt-in-your-mouth and so soft."
            },
            "accessory": {
                "type": "image",
                "image_url": "https://s3-media2.fl.yelpcdn.com/bphoto/korel-1YjNtFtJlMTaC26A/o.jpg",
                "alt_text": "alt text for image"
            }
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*Ler Ros*\n:star::star::star::star: 2082 reviews\n I would really recommend the  Yum Koh Moo Yang - Spicy lime dressing and roasted quick marinated pork shoulder, basil leaves, chili & rice powder."
            },
            "accessory": {
                "type": "image",
                "image_url": "https://s3-media2.fl.yelpcdn.com/bphoto/DawwNigKJ2ckPeDeDM7jAg/o.jpg",
                "alt_text": "alt text for image"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "actions",
            "elements": [
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "text": "Farmhouse",
                        "emoji": true
                    },
                    "value": "click_me_123"
                },
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "text": "Kin Khao",
                        "emoji": true
                    },
                    "value": "click_me_123",
                    "url": "https://google.com"
                },
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "text": "Ler Ros",
                        "emoji": true
                    },
                    "value": "click_me_123",
                    "url": "https://google.com"
                }
            ]
        }
    ]
}


'''


# SendActivity_Qy4SoS()
[Activity
 Attachments = ${json(slackmessage())}
]