2016-09-14 28 views
-2

我正在使用Microsoft Bot Framework在NodeJs中開發一個聊天bot。大多數情況下,它可以按預期完美工作。但有時當我與機器人通信時,我沒有立即得到答覆。進入第二個問題後,它不斷回答這兩個問題。幫我解決這個問題。我應該在服務器端做些什麼?Microsoft Bot框架無法按預期方式工作

dialog.matches('help',[ 
    function (session, args, next) {builder.Prompts.choice(session, "I can help you to shop products for your lifestyle. You can buy from the following categories.", "Computer|TV|See more", { listStyle: builder.ListStyle["list"] }); 

    }, 
    function (session, results) { 
     if (results.response.entity=='TV') { 
      session.send("Wow. That sounds interesting one. We have many %s models. Ask me question like \"I want to buy black color Samsung LED Tv .\"", results.response.entity); 
      session.endDialog(); 
     }else{ 
      session.send("Selected category is expected soon."); 
      session.endDialog(); 
     }   
    }]); 
+0

首先,您應該發佈一些代碼,以便我們可以看到您已嘗試過的內容 – DestinatioN

+0

我在問題中添加了一些代碼示例 –

回答

0

我的猜測是您遇到了一個Web Chat控件的已知問題。請參閱https://github.com/Microsoft/BotBuilder/issues/965以供參考。如果是這種情況,那麼您描述的行爲應該在5天前的更新中同時解決。

您可以請重新測試並確認問題是否仍然存在?

1

您可能會考慮使用Session.sendBatch方法強制排隊消息立即傳送。

相關問題