Why rich message created in dialogflow wouldn't appear in a bot tested on Slack?

狂风中的少年 提交于 2020-04-18 05:46:16

问题


I created two answers for the Default Welcome Intent.

One in the default one and the other as a text response which shows up in Slack and the other one using Slack as a channel of my bot, clicking on Add Response to start creating responses just for Slack using Dialogflows UI.

The second is the following, 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"
                }
            ]
        }
    ]
}

It should gives something like the following image when saying hi:

However if the first message shows up after launching the test in Integrations, the second never shows up, even in the little dialogbox on the right.

I thought the problem would be that I needed to make the bot public as it seems that to use rich messages, we have to copy the ‘Events Request URL' value given by Dialogflow and paste it into the 'Request URL' field from the Interactive Messages section of my Slack app settings. But the bot don't even retrieve the default message.

来源:https://stackoverflow.com/questions/61262287/why-rich-message-created-in-dialogflow-wouldnt-appear-in-a-bot-tested-on-slack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!