One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
| # show full path in Finder title bar (top) | |
| defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder | |
| # shorten the default notification duration (requires logout to take effect) | |
| defaults write com.apple.notificationcenterui bannerTime 1 |
| # oh-my-zsh Nils' Bureau Theme | |
| ### NVM | |
| ZSH_THEME_NVM_PROMPT_PREFIX="%B⬡%b " | |
| ZSH_THEME_NVM_PROMPT_SUFFIX="" | |
| ### Git [±master ▾●] | |
| ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg_bold[green]%}±%{$reset_color%}%{$fg_bold[white]%}" |
| private static Attachment GetHeroCard() | |
| { | |
| var heroCard = new HeroCard | |
| { | |
| Title = "BotFramework Hero Card", | |
| Subtitle = "Your bots — wherever your users are talking", | |
| Text = "Build and connect intelligent bots to interact with your users naturally wherever they are, from text/sms to Skype, Slack, Office 365 mail and other popular services.", | |
| Images = new List<CardImage> { new CardImage("http://chart.apis.google.com/chart?chs=200x200&chdlp=b&chtt=Uberman&chdl=Asleep%7CAw&chd=t:11,11,11,11,11,11,11,11,11,11,11,11&cht=p&chco=586F8E,red,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F") }, | |
| Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "Get Started", value: "https://docs.microsoft.com/bot-framework") } | |
| }; |
| /* | |
| .env: | |
| MICROSOFT_APP_ID= | |
| MICROSOFT_APP_PASSWORD= | |
| BING_MAPS_API_KEY= | |
| package.json: | |
| { | |
| "name": "botbuilder-location-example", | |
| "version": "0.7.0", |
| // This example assumes the existence of a .env file with the following contents: | |
| // <START_DOT_ENV> | |
| // LUIS_APP_ID="" | |
| // LUIS_SUBSCRIPTION_KEY="" | |
| // <END_DOT_ENV> | |
| require('dotenv').config(); | |
| var request = require('request'); | |
| var querystring = require('querystring'); |
| var builder = require('botbuilder'); | |
| var restify = require('restify'); | |
| //Server setup | |
| 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 restify = require('restify'); | |
| var builder = require('botbuilder'); | |
| var server = restify.createServer(); | |
| server.listen(process.env.port || process.env.PORT || 3978, function() { | |
| console.log('%s listening to %s', server.name, server.url); | |
| }); | |
| // Create the chat connector for communicating with the Bot Framework Service | |
| var connector = new builder.ChatConnector({appId: process.env.APP_ID, appPassword: process.env.APP_PASSWORD}); |
| // Welcome message for Node.js bot | |
| bot.on('conversationUpdate', function (message) { | |
| if (message.membersAdded) { | |
| message.membersAdded.forEach(function (identity) { | |
| if (identity.id == message.address.bot.id) { | |
| // Bot is joining conversation | |
| // - For WebChat channel you'll get this on page load. | |
| var reply = new builder.Message() | |
| .address(message.address) | |
| .text("Welcome to my page"); |