无法显示Amazon lex chatbot的多个响应卡 [英] Multiple response cards unable to be shown for Amazon lex chatbot

查看:50
本文介绍了无法显示Amazon lex chatbot的多个响应卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Amazon lex创建聊天机器人,并希望能够一次发布多个响应卡.聊天机器人提出的问题将是您当前有一个集成的Shield Plan吗?"然后是多个响应卡,其中将显示来自不同品牌的计划列表.但是,如果用户没有计划,则响应卡上会有一个名为否"的选项.

I am currently using Amazon lex to create a chatbot and want to be able to post multiple response cards at once. The question asked by the chatbot will be "Do you have an integrated Shield Plan currently?" and followed will be multiple response cards where it will show a list of plans from different brands. But if the user does not have a plan, there will be an option called "No" on the response card.

但是,如果我发布聊天机器人,让我们在Slack上说,甚至不会显示任何响应卡.我该如何解决这个问题?

But if I publish the chatbot let's say on Slack, not even one response card is shown. How do I fix this problem?

推荐答案

您尚未指定卡片图片网址,这就是为什么没有卡片的原因.我刚刚进行了测试,如果我们使用控制台进行设置,没有图像卡URL的ResponseCard将不会显示在Facebook或Slack上.

You have not specified the Card Image URL, this is why there is no card.
I have just now tested it, without Image Card URL ResponseCard will not be shown on Facebook or Slack if we are setting it using console.

但是,如果您要在Lambda功能中设置响应卡,那么我们可以选择不显示图像.您可以在 DialogCodeHook 中检查插槽是否已满,并相应地显示 ResponseCard .

However if you are setting Response Cards in Lambda function, then we can choose not to have an image. You can check that slot is filled or not in the DialogCodeHook and display the ResponseCard accordingly.

下面是显示没有图像的ResponseCard的示例代码:

Below is sample code to display ResponseCard without an image:

{
    'dialogAction': {
        'type': 'Close',
        'fulfillmentState': 'Fulfilled',
        'message': {
            'contentType': 'PlainText',
            'content': message
        },
        'responseCard': {
        'version': '0',
        'contentType': 'application/vnd.amazonaws.card.generic',
        'genericAttachments': [
            {
            'title': 'title1',
            'subTitle': 'subtitle',
            "buttons":[ 
             {
                "text":"button 1",
                "value":"value 1"
             },
             {
                "text":"button 2",
                "value":"value 2"
             },
             {
                "text":"button 3",
                "value":"value 3"
             }
                ]
            }
        }
    }
}

希望有帮助.

这篇关于无法显示Amazon lex chatbot的多个响应卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆