简体   繁体   中英

Getting Issue during re-calling the intent after rejecting Google Account linking

Below is my chatbot structure
Intent 1 (result): Here User will ask for a result. It will do the account linking and check the email id registration on their server whether it is registered or not via API and showing the result.

app.intent('result', (conv,{date})=>{ 
var userDate =  date;     
var apiUserEmailID=  conv.data.apiUserEmailID;   
var apiUserKey= conv.data.apiUserKey;    
console.log("apiUserKey : "+apiUserKey); 
if (typeof (apiUserKey) == "undefined" || apiUserKey == "" || apiUserKey == null) 
{
 conv.ask(new SignIn('To get your account details'));// Intent that starts the account linking flow.  
}
else
{   
 conv.ask("Welcome to quote generator"+userDate+" Session : "+apiUserKey); 
**//Flow should come here when ask for the next time after Google account linking**
}  
}); 

app.intent('user_Login', (conv, params, signin) => {// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event.  
if (signin.status === 'OK') 
{ 
const payload = conv.user.profile.payload;    
conv.data.apiUserEmailID=payload.email; //Session Creation    
var url = apiPathAJ+'/CheckAccess?uid=payload.email';  
var login_response="",login_Userkey="";    
return getaxiosURL(url).then(response => {  
response.data.map(loginObj=>{    
if(loginObj.Status=="TRUE")
{login_response = "1";
login_Userkey=loginObj.UserKey;}
else     
{login_response = "0";  
login_Userkey="0";}    
}); 
if(login_response=="1")
  {
   conv.data.apiUserKey=login_Userkey;   
   conv.ask("You are a registered User with Our Service. Here is your result *******");
  }
  else 
  { 
    conv.ask("You are not a registered User. Would you like to proceed with the Service registration.");
  }
}).catch (error => {
login_response="2";
console.log("Something is wrong in login_response("+login_response+") !! " + error);   
});

}
else 
  {
    conv.ask(`I won't be able to save your data, but what do you want to do next?`);
  }  
});

Below is the conversation example.
User: I want to see my result for 25th June 2019.
ChatBot:.....(It will ask for the account linking)
User: Yes
ChatBot:You are a registered User with Our Service.
User: I want to see my result for 25th June 2019.

Another conversation example.
User: I want to see my result for 25th June 2019.
ChatBot:.....(It will ask for the account linking)
User: No
ChatBot:I won't be able to save your data, but what do you want to do next?
User: I want to see my result for 25th June 2019.

In both the conversation, If user will ask the same question(user's last comment) or we can say it hits the intent (result), i am getting this exception and the conversation is existing.

Error: Dialogflow IntentHandler not found for intent: user_Login-result at Function. (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:141:31) at Generator.next () at fulfilled (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:19:58) at at process._tickDomainCallback (internal/process/next_tick.js:229:7)

The error message suggests that the "result-dailyPrediction" Intent is the one that has matched in Dialogflow, but there is no handler registered with app.intent('result-dailyPrediction') .

You should either register such an intent handler, or figure out why you're getting to that Intent and correct it (if it shouldn't be there).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM