Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function list(conv) {
conv.ask('This is a simple response for a list.');
conv.ask(new Suggestions(intentSuggestions));
conv.ask(new List({
title: 'List Title',
items: {
// Add the first item to the list
[SELECTION_KEY_GOOGLE_ASSISTANT]: {
synonyms: [
'Assistant',
'Google Assistant',
],
title: 'Item #1',
description: 'Description of Item #1',
image: new Image({
url: 'https://www.gstatic.com/images/branding/product/2x/assistant_48dp.png',
alt: 'Google Assistant logo',
}),
},
// Add the second item to the list
function list(conv) {
if (!conv.hasScreen) {
conv.ask('Sorry, try this on a screen device or select the ' +
'phone surface in the simulator.');
return;
}
conv.ask('This is a simple response for a list.');
conv.ask(new Suggestions(intentSuggestions));
// Create a list
conv.ask(new List({
title: 'List Title',
items: {
// Add the first item to the list
[SELECTION_KEY_ONE]: {
synonyms: [
'synonym of title 1',
'synonym of title 2',
'synonym of title 3',
],
title: 'Title of First List Item',
description: 'This is a description of a list item.',
image: new Image({
url: IMG_URL_AOG,
alt: 'Image alternate text',
}),
},
days[i]
}`
],
title: `${countLect}. At ${timeConvert(parseInt(key.substring(1)))}`,
description: `on ${days[i]}.`
};
console.log(
`at ${t - 12 > 0 ? `${t - 12} PM` : `${t} AM`} on ${days[i]}`
);
}
}
}
if (countLect >= 1) {
conv.close(`Total ${countLect} Lectures`);
conv.close(new List(result));
} else {
conv.close(
`In this semester there aren't any lectures of ${prof} in your department`
);
}
conv.ask(
new Suggestions([
`number of lectures of NTD`,
`number of lectures of SKB`,
`number of lectures of RJO`,
`next lecture please?`,
`Show Monday's schedule`,
`whose last lecture is it?`,
`first lecture today?`,
`Whose lecture is it?`
])
app.intent("ask_with_list", conv => {
conv.ask(
new SimpleResponse({
speech: "Here's Departments list",
text: "Here's Departments list."
}),
new List({
title: "Please select your department",
items: {
ICT_16: {
synonyms: ["SOT ICT 16", "ICT batch 16", "16BIT"],
title: "ICT-16",
description: "Information and Communication Technology, Batch'16"
},
ICT_17: {
synonyms: ["SOT ICT 17", "ICT batch 17", "17BIT"],
title: "ICT-17",
description: "Information and Communication Technology, Batch'17"
},
CE_16: {
synonyms: ["SOT CE 16", "CE batch 16", "16BCP"],
title: "CE-16",
description: "Computer Science Engineering, Batch'16"
' For more information say "meetup ' + (i + 1) + '". ';
}
}
ssmlText += '';
if ( hasAudio ) {
conv.ask(ssmlText.replace('&', ' and '));
} else {
conv.ask(textList);
conv.ask(responseToUser);
}
if (hasScreen) {
conv.ask(new List({
title: 'List of meetups: ',
items
}));
}
}
return conv;
}
const menu = conv => {
conv.ask("Here is our menu:");
conv.ask(
new List({
title: "Menu",
//You can add as many items as you want
items: {
["Menu 01"]: {
synonyms: ["menu 01", "item 01"],
title: "Big Hamburger",
description:
"Lorem ipsum dolor amet try-hard YOLO readymade" +
"poke truffaut plaid.",
image: new Image({
url:
"https://cdn20.patchcdn.com/users/790386/20180525/063909/styles/T800x600/public/processed_images/shutterstock_337714676-1527287683-3245.jpg",
alt: "Hamburger"
})
},