Skip to content

Instantly share code, notes, and snippets.

@dgkanatsios
Last active July 6, 2017 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgkanatsios/898f7840b65b9087f40a12df3c9a4a12 to your computer and use it in GitHub Desktop.
Save dgkanatsios/898f7840b65b9087f40a12df3c9a4a12 to your computer and use it in GitHub Desktop.
const restify = require('restify');
const builder = require('botbuilder');
const os = require('os');
const server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
var connector = new builder.ChatConnector({
appId: process.env.MICROSOFT_APP_ID,
appPassword: process.env.MICROSOFT_APP_PASSWORD
});
server.post('/api/messages', connector.listen());
const bot = new builder.UniversalBot(connector, function (session) {
session.send("You said: %s, machine that responds is %s", session.message.text, os.hostname);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment