【发布时间】:2021-06-18 16:12:04
【问题描述】:
使用 Microsoft Bot Framework Composer,我想使用 Block Kit 向 Slack 频道发送响应。我尝试使用 JSON 附件创建响应,但机器人返回:
机器人遇到错误或错误。要继续运行此机器人,请修复机器人源代码。
# 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?
【问题讨论】:
-
您在哪里找到将块工具包放入 Bot Framework 附件的语法?您可以链接到您一直关注的任何文档或示例吗?
-
我按照这里的示例代码。 stackoverflow.com/questions/66575227/… 但这与 MSFT 文档中列出的内容不同。 docs.microsoft.com/en-us/azure/bot-service/…我已经尝试了所有我能想到的组合。
-
你在使用像 Martin La Rosa 那样的 C# Slack 适配器吗?
-
是的。创建了一个新的 C# Empty Bot 模板并通过 Composer 的包管理器添加了 Slack Adapter。
标签: botframework bot-framework-composer