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

烈酒焚心 提交于 2020-08-10 22:24:33

问题


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)


回答1:


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).



来源:https://stackoverflow.com/questions/62449329/getting-issue-during-re-calling-the-intent-after-rejecting-google-account-linkin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!