简体   繁体   中英

Actions-on-google library List and Carousel not working

    ```
'use strict';
const functions = require('firebase-functions');
const { Button, dialogflow, BrowseCarouselItem, BrowseCarousel, Suggestions, List } = require('actions-on-google');
const axios = require('axios');

const app = dialogflow({ debug: true });

app.intent('Welcome', (conv) => {
    conv.ask(new BrowseCarousel({
        items: [
            new BrowseCarouselItem({
                title: 'Title of item 1',
                url: 'https://example.com',
                description: 'Description of item 1',
                image: new Image({
                    url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',
                    alt: 'Image alternate text',
                }),
            }),
            new BrowseCarouselItem({
                title: 'Title of item 2',
                url: 'https://example.com',
                description: 'Description of item 2',
                image: new Image({
                    url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',
                    alt: 'Image alternate text',
                }),
            }),
        ],
    }));
});

// Run the proper function handler based on the matched Dialogflow intent name
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);

I'm using the Dialogflow with actions-on-google and I'm facing the issue with it. On creating any rich message response, the bot just crashes without any error. I've also upgraded and downgraded the versions of the actions-on-google library but still facing the same issue.

Using Lists and Carousel with DialogFlow needs an extra simple response like conv.ask("this is a list") before the rich response. As it's written in the documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM