当我将按钮放入 Carousel 时出现错误
It gives error when I put button in Carousel
它给出错误并让我退出应用程序。当我推送选定的项目时,我想去 youtube link。
当我删除按钮时,它可以工作,但不会 link url。
错误是 MalformedResponse 由于平台响应无效,无法将 Dialogflow 响应解析为 AppResponse:在平台响应中找不到 RichResponse 或 SystemIntent
conv.ask(new Carousel({
items: {
'item 1': {
title: 'item 1',
buttons: new Button({
title: 'This is a button',
url: 'https://www.youtube.com/',
}),
url: 'https://www.youtube.com/',
description: 'Description of item 1',
image: new Image({
url: 'https://www.youtube.com/',
alt: 'aa',
})
},
'item 2': {
title: 'item 2',
buttons: new Button({
title: 'This is a button 2',
url: 'https://www.youtube.com/',
}),
url: 'https://www.youtube.com',
description: 'Descript',
image: new Image({
url: 'https://www.youtube.com/',
alt: 'item 2',
})
},
},
}));
如果您想要一组带有链接的项目,则需要使用 BrowseCarousel 而不是常规轮播。请记住,BrowseCarousel 没有按钮。
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',
}),
footer: 'Item 1 footer',
}),
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',
}),
footer: 'Item 2 footer',
}),
],
}));
它给出错误并让我退出应用程序。当我推送选定的项目时,我想去 youtube link。 当我删除按钮时,它可以工作,但不会 link url。 错误是 MalformedResponse 由于平台响应无效,无法将 Dialogflow 响应解析为 AppResponse:在平台响应中找不到 RichResponse 或 SystemIntent
conv.ask(new Carousel({
items: {
'item 1': {
title: 'item 1',
buttons: new Button({
title: 'This is a button',
url: 'https://www.youtube.com/',
}),
url: 'https://www.youtube.com/',
description: 'Description of item 1',
image: new Image({
url: 'https://www.youtube.com/',
alt: 'aa',
})
},
'item 2': {
title: 'item 2',
buttons: new Button({
title: 'This is a button 2',
url: 'https://www.youtube.com/',
}),
url: 'https://www.youtube.com',
description: 'Descript',
image: new Image({
url: 'https://www.youtube.com/',
alt: 'item 2',
})
},
},
}));
如果您想要一组带有链接的项目,则需要使用 BrowseCarousel 而不是常规轮播。请记住,BrowseCarousel 没有按钮。
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',
}),
footer: 'Item 1 footer',
}),
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',
}),
footer: 'Item 2 footer',
}),
],
}));