..
This commit is contained in:
@@ -68,14 +68,13 @@ alexaApp.request = (jsonRequest) => {
|
|||||||
if (alexaRequest.type() === "IntentRequest") {
|
if (alexaRequest.type() === "IntentRequest") {
|
||||||
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err,skill)=>{
|
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err,skill)=>{
|
||||||
if (skill) {
|
if (skill) {
|
||||||
|
console.log(alexaRequest.data.request.intent);
|
||||||
let intentId = findElementByAttr(skill.intents, 'intentName', alexaRequest.data.request.intent.name);
|
let intentId = findElementByAttr(skill.intents, 'intentName', alexaRequest.data.request.intent.name);
|
||||||
console.log(alexaRequest.data.request.intent.name);
|
|
||||||
console.log(intentId);
|
|
||||||
const response = new alexa.response(alexaRequest.getSession());
|
const response = new alexa.response(alexaRequest.getSession());
|
||||||
if (intentId !== -1){
|
if (intentId !== -1){
|
||||||
response.say(skill.intents[intentId].answer);
|
return response.say(skill.intents[intentId].answer);
|
||||||
}else{
|
}else{
|
||||||
response.say('Sorry, I could not find desired intent');
|
return response.say('Sorry, I could not find desired intent');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user