Skip to content

Instantly share code, notes, and snippets.

@joshskeen
Created May 3, 2016 15:28
Show Gist options
  • Save joshskeen/459da370f097f02436cb6d21781a4f01 to your computer and use it in GitHub Desktop.
Save joshskeen/459da370f097f02436cb6d21781a4f01 to your computer and use it in GitHub Desktop.
custom utterance support for an alexa-app skill
var skillService = new Skill.app('myskill');
var utterancesMethod = skillService.utterances;
skillService.utterances = function() {
return utterancesMethod().replace(/\{\-\|/g, '{');
};
skillService.intent('airportInfoIntent', {
'slots': {
'AIRPORTCODE': 'FAACODES'
},
'utterances': ['{|flight|airport} {|delay|status} {|info} {|for} {-|AIRPORTCODE}']
},
function(req, res) {
var airportCode = req.slot('AIRPORTCODE');
... skill goes here!
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment