简体   繁体   English

如何在Microsoft Bot Framework的node.js版本中“退出”?

[英]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): 我认为您想将triggerActionendConversation一起使用(而不是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.

相关问题 如何在Microsoft团队中添加Microsoft BotBuilder框架Node.js版本4 Bot? - How to add the microsoft botbuilder framework node.js version 4 bot in microsoft teams? 如何为 bot 响应添加延迟,使其在 Microsoft Bot Framework Node.js 中感觉更真实? - How to add a delay to bot responses, so it feels more real in Microsoft Bot Framework Node.js? 使用Node.js Microsoft Bot Framework显示图像 - Display images using the Node.js Microsoft Bot Framework 在Microsoft Bot Framework(Node.js)中的对话框之间切换 - Switches between Dialog in Microsoft Bot Framework (Node.js) 在Microsoft Bot Framework for Skype(node.js)中提示输入文件 - Prompt for file in Microsoft Bot Framework for Skype (node.js) Microsoft Bot Framework 3.15 中用于 Node.js 的“reloadAction”未传递“dialogArgs” - 'reloadAction' in Microsoft Bot Framework 3.15 for Node.js is not passing on 'dialogArgs' 带有node.js的Microsoft bot框架以及数据库和流 - microsoft bot framework with node.js plus database and flow 如何在 Microsoft Bot Framework v.3 (Node.js) 中发送欢迎消息并自动加载特定对话框? - How to send welcome message AND load a specific dialog automatically in Microsoft Bot Framework v.3 (Node.js)? 在bot.use中设置event.textLocale(Node.js Microsoft Bot Framework) - Setting event.textLocale in bot.use (Node.js Microsoft Bot Framework) 什么决定了“bot.dialog”何时传递到 Microsoft Bot Framework 中瀑布的下一个 function? (Node.js) - What determines when 'bot.dialog' passes to the next function of the waterfall in Microsoft Bot Framework? (Node.js)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM