2016-03-27 16:22:50 -04:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var handlers = require('./handlers.js');
|
|
|
|
|
|
|
|
var alexa = require('alexa-app');
|
|
|
|
var app = new alexa.app('sickBeard');
|
|
|
|
|
|
|
|
app.launch(handlers.handleLaunchIntent);
|
|
|
|
app.intent('FindShow', handlers.handleFindShowIntent);
|
|
|
|
app.intent('AddShow', handlers.handleAddShowIntent);
|
|
|
|
app.intent('AMAZON.YesIntent', handlers.handleYesIntent);
|
|
|
|
app.intent('AMAZON.NoIntent', handlers.handleNoIntent);
|
|
|
|
app.intent('AMAZON.CancelIntent', handlers.handleCancelIntent);
|
|
|
|
|
2016-03-27 18:02:00 -04:00
|
|
|
app.post = function(request, response, type, exception) {
|
|
|
|
if (exception) {
|
|
|
|
// Always turn an exception into a successful response
|
|
|
|
response.clear().say('An error occured: ' + exception).send();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-03-27 16:22:50 -04:00
|
|
|
module.exports = app;
|