[英]How to 'exit' in the node.js version of Microsoft Bot Framework?
I want to call the session.endDialog whenever the user inputs 'exit' as the message. 每当用户输入“ exit”作为消息时,我都想调用session.endDialog。
Currently, my bot has many types of dialogues, but i want the bot to end the conversation when the 'exit' is typed by the user regardless of which dialogue the user is currently in. 目前,我的漫游器具有多种类型的对话,但是我希望该漫游器在用户键入“退出”时结束对话,而与用户当前处于哪种对话无关。
Is there a way to do this? 有没有办法做到这一点?
I think you want to use triggerAction along with endConversation (instead of endDialog): 我认为您想将triggerAction与endConversation一起使用(而不是endDialog):
// reset the bot
bot.dialog('reset', function (session) {
// reset data
session.endConversation("Ok… Goodbye.");
}).triggerAction({ matches: /^exit/i });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.