-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contiene el archivo app.js donde se encuentra toda la lógica del Chatbot y el archivo package.json de dependencias.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
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); | ||
}); |
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
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" | ||
} | ||
} |