我为默认的欢迎意图创建了两个答案。
默认情况下一个作为文本响应,另一个作为文本响应显示在Slack中,而另一个使用Slack作为我的机器人的通道,单击“添加响应”以开始使用Dialogflows UI为Slack创建响应。
第二个是以下,a default template for polling from the docs:
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Where should we order lunch from?* Poll by <fakeLink.toUser.com|Mark>"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":sushi: *Ace Wasabi Rock-n-Roll Sushi Bar*\nThe best landlocked sushi restaurant."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Vote"
},
"value": "click_me_123"
}
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://api.slack.com/img/blocks/bkb_template_images/profile_1.png",
"alt_text": "Michael Scott"
},
{
"type": "image",
"image_url": "https://api.slack.com/img/blocks/bkb_template_images/profile_2.png",
"alt_text": "Dwight Schrute"
},
{
"type": "image",
"image_url": "https://api.slack.com/img/blocks/bkb_template_images/profile_3.png",
"alt_text": "Pam Beasely"
},
{
"type": "plain_text",
"emoji": true,
"text": "3 votes"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":hamburger: *Super Hungryman Hamburgers*\nOnly for the hungriest of the hungry."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Vote"
},
"value": "click_me_123"
}
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://api.slack.com/img/blocks/bkb_template_images/profile_4.png",
"alt_text": "Angela"
},
{
"type": "image",
"image_url": "https://api.slack.com/img/blocks/bkb_template_images/profile_2.png",
"alt_text": "Dwight Schrute"
},
{
"type": "plain_text",
"emoji": true,
"text": "2 votes"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":ramen: *Kagawa-Ya Udon Noodle Shop*\nDo you like to shop for noodles? We have noodles."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Vote"
},
"value": "click_me_123"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "No votes"
}
]
},
{
"type": "divider"
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Add a suggestion"
},
"value": "click_me_123"
}
]
}
]
}
当打个招呼时,它应该给出如下图所示的内容:
但是,如果在Integrations中启动测试后出现第一条消息,即使在右边的小对话框中也不会显示第二条消息。
我以为问题是因为我需要公开bot,因为要使用丰富消息,我们必须复制Dialogflow给出的'Events Request URL'值并将其粘贴到我的Slack应用设置的“交互式消息”部分。但是该漫游器甚至都不会检索默认消息。
我为默认的欢迎意图创建了两个答案。默认情况下,一个作为文本响应显示在Slack中,另一个作为文本响应显示在Slack中,单击...
为了能够使用自定义有效负载发送所需的响应,您应该首先添加Dialogflow向松弛发送请求所需的格式。