Benvenuto → Informazioni su GDG → Prossimo evento → Ultimo evento
/** Handles the welcome intent. */ app.intent(‘Default Welcome Intent’, (conv) => conv.data.intentFulfilled = [0, 0, 0, 0, 0, 0]; // code}
“SUGGESTIONS”: { “MENU”: [ “About GDG”, “Next event”, “Last event”, “# of Members”, “Organizer’s Name”, “Bye” ] },
/** * Records which options the user has complete * @param {obj} conv, the conversation object. * @param num conv, the conversation object. * @return {null} none. */ function recordsIntentFulfillment(conv, intentName) { const convertIntentValue = { 'gdg': 0, 'next event': 1, 'last event': 2, 'members': 3, 'organizer': 4, }; conv.data.intentFulfilled[convertIntentValue[intentName]] = 1; return null; }
/** * Handles the Dialogflow intent named ‘next event’. */ app.intent(‘next event’, async (conv) => { recordsIntentFulfillment(conv, ‘next event’); // logic of the message conv.ask(new Suggestions(selectSuggestionChips(conv)));