Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function createHeroCard(session) { | |
return new builder.HeroCard(session) | |
.title('Evolución de los niveles de NO2') | |
//.subtitle('Using a Chart as Image service...') | |
.text(statusLabel) | |
.buttons([ | |
builder.CardAction.openUrl(session, 'https://www.madrid.es/UnidadesDescentralizadas/Sostenibilidad/CalidadAire/Ficheros/ProtocoloSuperaNO2consol.pdf', 'Detalles de aplicación del protocolo de contaminación'), | |
builder.CardAction.openUrl(session, 'https://www.madrid.es/portales/munimadrid/es/Inicio/Movilidad-y-transportes/Preguntas-frecuentes-generales-sobre-el-protocolo-para-episodios-de-alta-contaminacion/?vgnextfmt=default&vgnextoid=6ac1c93b6ca18510VgnVCM2000001f4a900aRCRD&vgnextchannel=220e31d3b28fe410VgnVCM1000000b205a0aRCRD', 'FAQ sobre el protocolo de contaminación') | |
]); | |
}; |
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
function lucaQuality(payload, cb) { | |
const options = { | |
method: "POST", | |
hostname: '123.456.78.910', | |
port: '1111', | |
path: ["/quality"], | |
headers: { | |
"Content-Type": 'application/x-www-form-urlencoded', | |
"Authorization": 'Basic ********' |
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
// log any bot errors into the console | |
bot.on('error', function (e) { | |
console.log('An error ocurred', e); | |
}); |
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('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 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 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 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'; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.