Last active
October 23, 2018 07:34
-
-
Save eblancoh/347dd4d117219e9b5da73a1a481984f3 to your computer and use it in GitHub Desktop.
This file contains 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 | | |
locationDialog.LocationRequiredFields.locality | | |
locationDialog.LocationRequiredFields.region | | |
locationDialog.LocationRequiredFields.postalCode | | |
locationDialog.LocationRequiredFields.country | |
}); | |
}, | |
(session, results, next) => { | |
if (results.response) { | |
session.dialogData.place = results.response | |
session.send(session.dialogData.place.streetAddress + ", " + session.dialogData.place.locality + ", " + | |
session.dialogData.place.region + ", " + session.dialogData.place.country + " (" + session.dialogData.place.postalCode + ")"); | |
} else { | |
session.cancelDialog(); | |
} | |
session.endDialogWithResult({ response: session.dialogData.place }); | |
} | |
]); | |
bot.library(locationDialog.createLibrary(BING_MAPS_KEY)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment