Skip to content

Instantly share code, notes, and snippets.

@dgkanatsios

dgkanatsios/samplebot.js

Last active Jul 6, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.