apply changes from PR #15

This commit is contained in:
GotPPay
2018-04-03 15:56:13 +02:00
9 changed files with 148 additions and 134 deletions

View File

@@ -6,14 +6,6 @@ const constants = require ('../config/constants');
let parser = new Parser ();
getDataFromRSSFeed = function (url) {
//let feed = await parser.parseURL(url);
//console.log(feed.title);
//feed.items.forEach(item => {
// console.log(item.title + ':' + item.link)
//});
};
getDataFromWPJSON = function (sourceUrl, page = 1, maxPosts = 10) {
return new Promise ((resolve, reject) => {
var options = {

View File

@@ -7,6 +7,7 @@ let predefinedSourceHelper = require ('../helpers/externalSource');
var handlers = {};
var destinationEmail;
let skillName;
module.exports = {
run: function (req, res) {
@@ -33,6 +34,7 @@ module.exports = {
.then (activeSkill => {
handlers = {};
destinationEmail = activeSkill.contactEmail;
skillName = activeSkill.invocationName;
let listOfPossibleQuestions = '';
activeSkill.intents.forEach (intent => {
@@ -77,7 +79,7 @@ module.exports = {
reject: null,
};
let answer = new Promise ((resolve, reject) => {
let answerPromise = new Promise ((resolve, reject) => {
answerPromiseProps = {
resolve: resolve,
reject: reject,
@@ -116,7 +118,7 @@ module.exports = {
break;
}
answer
answerPromiseProps
.then (answer => {
this.response
.speak (answer)
@@ -230,7 +232,7 @@ module.exports = {
if (this.attributes['LaunchRequestYesNo']) {
this.attributes['LaunchRequestYesNo'] = false;
}
this.response.speak ('Thank you for using Saburly');
this.response.speak (`Thank you for using ${skillName}`);
this.emit (':responseReady');
};