Where is the value the user has given?

244
December 27, 2017, at 00:29 AM

First of all I'm the beginner the node.js and trying to understand:

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

How can I get the user's input for later use after this code, let's say the user said california where is it stored and how can I use it in another function?

Answer 1

This is the proper way to get the prompts data as 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}!`);
    }
]);

See More Info : https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-dialog-prompt

Rent Charter Buses Company
READ ALSO
How to output firebase database query into VueJs page

How to output firebase database query into VueJs page

Currently I am querying a Firebase database for the current users usernameI would like the value to display on the page inside the <template> area

293
Insert HTML and JS widget to every page using Chrome extension

Insert HTML and JS widget to every page using Chrome extension

I would like to insert a simple notification bar widget to the top of every page which would show some information dynamically

245
Highlighting common words in multiple strings in array using JavaScript [on hold]

Highlighting common words in multiple strings in array using JavaScript [on hold]

I am trying to highlight the common words in sentences from an array

266
Splash Screen is not showing with phone gap. (Intel XDK package)

Splash Screen is not showing with phone gap. (Intel XDK package)

guys, I know that Intel XDK is not being used anymore but I'm creating a project with this programmeI am trying to enabling the splash screen but when previewing my app on PhoneGap it keeps loading

182