Skip to content

Commit

Permalink
handle gracefully unrelated requests issue internetarchive#344
Browse files Browse the repository at this point in the history
  • Loading branch information
UmerMIB committed Mar 23, 2020
1 parent e285add commit f49272e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions functions/src/actions/fallback-no.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const exist = require('./exit');

/**
* Handle Alexa Amazon.CancelIntent
* Assistant doesn't touch this event
* cancel and exist are synonymous intents
*
* @type {{handler: handler}}
*/
module.exports = {
handler: exist.handler,
};
6 changes: 6 additions & 0 deletions functions/src/actions/fallback-yes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const strings = require('../strings');
const helpers = require('./_helpers');

module.exports = {
handler: (app) => helpers.simpleResponse(app, strings.intents.fallback_yes),
};
7 changes: 5 additions & 2 deletions functions/src/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ module.exports = {
// because in alexa it is The Internet Archive Skill
// but on Google Assistant it would be The Internet Archive Action
speech:
'<s>{{platform.appName}} can not help with that.</s> ' +
'<s>{{last.reprompt}}</s>'
'<s>Oops! You are still in Internet Archive Service. Do you want to continue?</s>'
},

fallback_yes:{
speech: '<s> repeat the question or continue playback </s>'
},

getFSMState: {
Expand Down

0 comments on commit f49272e

Please sign in to comment.