Skip to content

Commit

Permalink
Merge pull request #35 from CatalystCode/proxy-mode
Browse files Browse the repository at this point in the history
Proxy mode
  • Loading branch information
amiturgman authored Aug 1, 2017
2 parents 3029aae + 9924805 commit 02b3777
Show file tree
Hide file tree
Showing 38 changed files with 1,607 additions and 14,054 deletions.
13 changes: 7 additions & 6 deletions examples/handlers/set_alarm.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@

module.exports = function (session, next, data) {
module.exports = (session, next, data) => {

var intent = session.privateConversationData[data.source];
var intent = session.dialogData.data[data.source];
var alarmTime = null;
if (intent.actions[0].parameters[0].name == "time") {
// alarmTime = intent.entities...
// use intent.entities to extract relevant information
// assuming extracted alarmTime
alarmTime = '2016-10-10 10:10';
// use intent.entities to extract relevant information
// assuming extracted alarmTime

alarmTime = '2016-10-10 10:10';
}

if (data.target && alarmTime) {
session.dialogData.data[data.target] = alarmTime;
}

session.send('Alarm set for ' + alarmTime);
next();
return next();
}
4 changes: 2 additions & 2 deletions examples/handlers/summary.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

module.exports = function (session, next) {
module.exports = (session, next) => {
var summary = "Summary: ";
for (var prop in session.dialogData.data) {
summary += prop + ': [' + session.dialogData.data[prop] + ']; ';
}
session.send(summary);
next();
return next();
}
9 changes: 0 additions & 9 deletions lib/Action.js

This file was deleted.

Loading

0 comments on commit 02b3777

Please sign in to comment.