簡體   English   中英

在拒絕 Google 帳戶鏈接后重新調用意圖期間出現問題

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

下面是我的聊天機器人結構
意圖 1(結果):用戶將在此處詢問結果。 它將執行帳戶鏈接並檢查其服務器上的 email id 注冊是否通過 API 注冊並顯示結果。

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?`);
  }  
});

下面是對話示例。
用戶:我想查看 2019 年 6 月 25 日的結果。
ChatBot:.....(它會要求帳戶鏈接)
用戶:是的
ChatBot:您是我們服務的注冊用戶。
用戶:我想查看 2019 年 6 月 25 日的結果。

另一個對話示例。
用戶:我想查看 2019 年 6 月 25 日的結果。
ChatBot:.....(它會要求帳戶鏈接)
用戶:沒有
ChatBot:我將無法保存您的數據,但您接下來要做什么?
用戶:我想查看 2019 年 6 月 25 日的結果。

在這兩個對話中,如果用戶會問相同的問題(用戶的最后評論)或者我們可以說它達到了意圖(結果),我得到這個異常並且對話是存在的。

錯誤:未找到 Dialogflow IntentHandler 的意圖:Function 的 user_Login-result。 (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:141:31) 在 Generator.next () 完成時 (/srv/node_modules/actions-on-google/dist/service/ dialogflow/dialogflow.js:19:58) 在 process._tickDomainCallback (internal/process/next_tick.js:229:7)

錯誤消息表明“result-dailyPrediction”意圖是在 Dialogflow 中匹配的意圖,但沒有使用app.intent('result-dailyPrediction')注冊處理程序。

您應該注冊這樣的意圖處理程序,或者弄清楚為什么要訪問該意圖並更正它(如果它不應該存在的話)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM