Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const https = require('https'); | |
| const restify = require('restify'); | |
| const builder = require('botbuilder'); | |
| const locationDialog = require('botbuilder-location'); | |
| const moment = require('moment-timezone'); | |
| const qs = require("querystring"); | |
| const BING_MAPS_KEY = 'BING_MAPS_KEY'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Receive messages from the user and respond by echoing each message back (prefixed with 'You said:') | |
| const bot = new builder.UniversalBot(connector, [ | |
| (session, results, next) => { | |
| session.preferredLocale('es', (err) =>聽{ | |
| if (err) { | |
| session.error('error'); | |
| } | |
| session.send("Bienvenido al Chatbot Eco de Luca"); | |
| next(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bot.dialog('locationBot', [ | |
| (session) => { | |
| locationDialog.getLocation(session, { | |
| prompt: "驴Para qu茅 localizaci贸n desea obtener una predicci贸n?", | |
| useNativeControl: false, | |
| reverseGeocode: false, | |
| skipFavorites: true, | |
| skipConfirmationAsk: true, | |
| requiredFields: | |
| locationDialog.LocationRequiredFields.streetAddress | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bot.dialog('locationfavorites', [ | |
| (session, results, next) => { | |
| var msg = new builder.Message(session) | |
| .text("驴Desea seleccionar una localizaci贸n predeterminada? Si no, diga o escriba 'no'") | |
| .suggestedActions( | |
| builder.SuggestedActions.create( | |
| session, [ | |
| builder.CardAction.postBack(session, "orense_madrid", "Casa"), | |
| builder.CardAction.postBack(session, "gran_via", "Trabajo"), | |
| builder.CardAction.postBack(session, "distrito_telefonica", "Distrito"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // log any bot errors into the console | |
| bot.on('error', function (e) { | |
| console.log('An error ocurred', e); | |
| }); |