Skip to content

Commit

Permalink
Código principal
Browse files Browse the repository at this point in the history
Contiene el archivo app.js donde se encuentra toda la lógica del Chatbot y el archivo package.json de dependencias.
  • Loading branch information
Ric01 authored Nov 1, 2018
1 parent c84dcf0 commit 56c4504
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var restify = require('restify');
var builder = require('botbuilder');

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});



var inMemoryStorage = new builder.MemoryBotStorage();
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword
});

// Listen for messages from users
server.post('/api/messages', connector.listen());

// Receive messages from the user and respond by echoing each message back (prefixed with 'You said:')
var bot = new builder.UniversalBot(connector, function (session) {
session.send("Tú dijiste: %s", session.message.text);
});
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "echobot",
"version": "1.0.0",
"description": "Bot que escribe de vuelta al usuario el mensaje recibido",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Ric01/Echobot.git"
},
"keywords": [
"chatbot",
"azure",
"bot",
"botframework",
"microsoft"
],
"author": "Ricardo Suarez",
"license": "ISC",
"bugs": {
"url": "https://github.com/Ric01/Echobot/issues"
},
"homepage": "https://github.com/Ric01/Echobot#readme",
"dependencies": {
"botbuilder": "^3.15.0",
"restify": "^7.2.2"
}
}

0 comments on commit 56c4504

Please sign in to comment.