-
Create a new Intent name:
addSchedule. -
Under Training phrases type:
add schedule on 5th July for yourmessage at yourTimeand Change the parameters name:a,bandc. -
Then go to Fulfillment session under intent. and
Enable webhook call for this intent. -
Now go to Fulfillment menu undersidebar and
EnabletheInline Editor. -
Define
intentMap.set('YourIntentName', FunctionsName)Functions. For example in this intent I'm usingintentMap.set('addSchedule', addNewSchedule);
-
Create a function named 'addTwoNumbers'.
function addNewSchedule(agent){ var time =agent.parameters.a; var date =agent.parameters.b; var msg = agent.parameters.c; firebase.database().ref('schedules').push({ time:time, date:date, message:msg }); agent.add('Your Schedule for '+msg+' on '+ date +' at '+time +' has added successfully.'); }
-
Add
const firebase = require("firebase"); -
Add
"firebase ":"*"in dependencies. -
Add Firebase key in
index.jsfile. -
Click on Deploy Button
-
Test it.
Varsha-Jaiswal/AoG-Scheduler
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|