ファイル管理を少し簡単にして、それぞれのインテントを独自のファイルにしようとしています。私のindex.jsがそのインテントを使用するようにするにはどうすればよいですか。Heresと私が試した例。
var alexa = require('alexa-app');
var app = new alexa.app();
var GetLunchSuggestions = require('./Intents/GetLunchSuggestions');
app.launch(function(request, response) {
response.say('Welcome I am built to handle your lunch requests');
response.shouldEndSession(false);
});
app.use(GetLunchSuggestions);
// Connect to lambda
exports.handler = app.lambda();
if (process.argv.length === 3 && process.argv[2] === 'schema') {
console.log(app.schema());
console.log(app.utterances());
}
このファイルで昼食の提案インテントを使用したい。これどうやってやるの?