最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

用户给出的价值在哪里?

运维笔记admin10浏览0评论

用户给出的价值在哪里?

用户给出的价值在哪里?

首先,我是node.js的初学者,并试图理解:

bot.dialog('askForLocation', [
  function (session, args) {
    if (args && args.reprompt) {
      builder.Prompts.text(session, "Enter a proper location");
    } else {
      builder.Prompts.text(session, "What's your meeting location?");
    }
  },

我怎样才能获得用户输入以供以后使用此代码后,让用户说california存储在哪里以及如何在另一个函数中使用它?

回答如下:

这是将prompts数据作为response获取的正确方法

bot.dialog('askForLocation', [
    // Step 1
    function (session) {
        if (args && args.reprompt) {
          builder.Prompts.text(session, "Enter a proper location");
        } else {
          builder.Prompts.text(session, "What's your meeting location?");
        }
    },
    // Step 2
    function (session, results) {
        session.endDialog(`Hello from location name = ${results.response}!`);
    }
]);

查看更多信息:https://docs.microsoft/en-us/bot-framework/nodejs/bot-builder-nodejs-dialog-prompt

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论