Hello!
I have a question about the functions located outside the app.setHandler.
For example, imagine that you have the following code inside app.setHandler:
if (this.$inputs.color.value === 'blue') {
speech = 'You chose to go through the blue door.'
\+ ' There is a dark, long floor. Suddenly, you hear a sound from a room at the end of it.'
\+ ' Do you want to follow the sound?';
reprompt = 'Please say yes or no.';
this.ask(speech, reprompt);
}
If I add this code to a function such that:
if (this.$inputs.color.value === 'blue') {
readFunction();
}
And out of the app.setHandler I add these function:
function readFunction() {
speech = 'You chose to go through the blue door.
\+ ' There is a dark, long floor. Suddenly, you hear a sound from a room at the end of it.
\+ ' Do you want to follow the sound?';
reprompt = 'Please say yes or no.';
this.ask(speech, reprompt);
}
I have an error in this.ask:
Message:
Cannot read property ‘ask’ of undefined
Can someone help me? Thank you in advance!