Skip to content

Commit

Permalink
README updates to reflect latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcostantini committed Feb 25, 2017
1 parent 996ea0d commit 69befe5
Show file tree
Hide file tree
Showing 18 changed files with 171 additions and 162 deletions.
2 changes: 1 addition & 1 deletion Node/cards-CarouselCards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The minimum prerequisites to run this sample are:

### Code Highlights

You can send multiple rich card attachments in a single message. On most channels they will be sent as a list of rich cards, but some channels (like Skype and Facebook) can render them as a carousel of rich cards. The `Message.attachmentLayout()` method allows you to control how the rich cards will be rendered. Check out the key code located in [app.js](app.js#L23) class where the attachments layout is changed to the Carousel mode.
You can send multiple rich card attachments in a single message. On most channels they will be sent as a list of rich cards, but some channels (like Skype and Facebook) can render them as a carousel of rich cards. The `Message.attachmentLayout()` method allows you to control how the rich cards will be rendered. Check out the key code located in [app.js](app.js#L26) class where the attachments layout is changed to the Carousel mode.


> Note: Only the [Hero](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.herocard.html) and [Thumbnail](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.thumbnailcard.html) Cards are supported for the Carousel AttachmentLayout mode.
Expand Down
16 changes: 8 additions & 8 deletions Node/cards-RichCards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The minimum prerequisites to run this sample are:

### Code Highlights

Many messaging channels provide the ability to attach richer objects. The Bot Framework has the ability to render rich cards as attachments. There are several types of cards supported: Hero Card, Thumbnail Card, Receipt Card, Sign-In Card, Animation Card, Video Card and Audio Card. Once the desired Card type is selected, it is mapped into an `Attachment` data structure. Check out the key code located in [app.js](app.js#L26-L32) where a card is attached to the constructed message.
Many messaging channels provide the ability to attach richer objects. The Bot Framework has the ability to render rich cards as attachments. There are several types of cards supported: Hero Card, Thumbnail Card, Receipt Card, Sign-In Card, Animation Card, Video Card and Audio Card. Once the desired Card type is selected, it is mapped into an `Attachment` data structure. Check out the key code located in [app.js](app.js#L29-L35) where a card is attached to the constructed message.

````JavaScript
function (session, results) {
Expand All @@ -32,7 +32,7 @@ function (session, results) {

#### Hero Card

The Hero card is a multipurpose card; it primarily hosts a single large image, a button, and a "tap action", along with text content to display on the card. Check out the `createHeroCard` function in [app.js](app.js#L66-L77) for a Hero Card sample.
The Hero card is a multipurpose card; it primarily hosts a single large image, a button, and a "tap action", along with text content to display on the card. Check out the `createHeroCard` function in [app.js](app.js#L69-L80) for a Hero Card sample.

````JavaScript
function createHeroCard(session) {
Expand All @@ -50,7 +50,7 @@ function createHeroCard(session) {
````

#### Thumbnail Card
The Thumbnail card is a multipurpose card; it primarily hosts a single small image, a button, and a "tap action", along with text content to display on the card. Check out the `createThumbnailCard` function in [app.js](app.js#L79-L90) for a Thumbnail Card sample.
The Thumbnail card is a multipurpose card; it primarily hosts a single small image, a button, and a "tap action", along with text content to display on the card. Check out the `createThumbnailCard` function in [app.js](app.js#L82-L93) for a Thumbnail Card sample.

```JavaScript
function createThumbnailCard(session) {
Expand All @@ -68,7 +68,7 @@ function createThumbnailCard(session) {
````

#### Receipt Card
The receipt card allows the Bot to present a receipt to the user. Check out the `createReceiptCard` function in [app.js](app.js#L93-L114) for a Receipt Card sample.
The receipt card allows the Bot to present a receipt to the user. Check out the `createReceiptCard` function in [app.js](app.js#L96-L117) for a Receipt Card sample.

````JavaScript
function createReceiptCard(session) {
Expand Down Expand Up @@ -96,7 +96,7 @@ function createReceiptCard(session) {
````

#### Sign-In Card
The Sign-In card is a card representing a request to sign in the user. Check out the `createSigninCard` function in [app.js](app.js#L116-L120) for a Sign-In Card sample.
The Sign-In card is a card representing a request to sign in the user. Check out the `createSigninCard` function in [app.js](app.js#L119-L123) for a Sign-In Card sample.

> Note: The sign in card can be used to initiate an authentication flow which is beyond this sample. For a complete authentication flow sample take a look at [AuthBot](https://github.com/MicrosoftDX/AuthBot) (Please, notice the samples are currently in C# only).

Expand All @@ -109,7 +109,7 @@ function createSigninCard(session) {
````

#### Animation Card
The Animation card is a card that’s capable of playing animated GIFs or short videos. Check out the `createAnimationCard` method in [app.js](app.js#L122-L130) for an Animation Card sample.
The Animation card is a card that’s capable of playing animated GIFs or short videos. Check out the `createAnimationCard` method in [app.js](app.js#L125-L133) for an Animation Card sample.

````JavaScript
function createAnimationCard(session) {
Expand All @@ -126,7 +126,7 @@ function createAnimationCard(session) {
> Note: At the time of writing this sample, Skype requires the Animation card to have a Thumbnail Url.

#### Video Card
The Video card is a card that’s capable of playing videos. Check out the `createVideoCard` method in [app.js](app.js#L132-L144) for a Video Card sample.
The Video card is a card that’s capable of playing videos. Check out the `createVideoCard` method in [app.js](app.js#L135-L147) for a Video Card sample.

````JavaScript
function createVideoCard(session) {
Expand All @@ -147,7 +147,7 @@ function createVideoCard(session) {
> Note: At the time of writing this sample, Skype requires the Video card to have a Thumbnail Url.

#### Audio Card
The Audio card is a card that’s capable of playing an audio file. Check out the `createAudioCard` method in [app.js](app.js#L146-L158) for an Audio Card sample.
The Audio card is a card that’s capable of playing an audio file. Check out the `createAudioCard` method in [app.js](app.js#L149-L161) for an Audio Card sample.

````JavaScript
function createAudioCard(session) {
Expand Down
2 changes: 1 addition & 1 deletion Node/core-AppInsights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The minimum prerequisites to run this sample are:
* Latest Node.js with NPM. Download it from [here](https://nodejs.org/en/download/).
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://emulator.botframework.com/). Please refer to [this documentation article](https://github.com/microsoft/botframework-emulator/wiki/Getting-Started) to know more about the Bot Framework Emulator.
* **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free.
* An Application Insights instance in Azure. The Instrumentation Key for which must be put in the `APPINSIGHTS_INSTRUMENTATION_KEY` key in [.env](.env) file to try it out further.
* An Application Insights instance in Azure. The Instrumentation Key for which must be put in the `APPINSIGHTS_INSTRUMENTATION_KEY` key in the [.env](.env) file to try it out further.

### Code Highlights

Expand Down
4 changes: 2 additions & 2 deletions Node/core-ChannelData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The minimum prerequisites to run this sample are:
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://emulator.botframework.com/). Please refer to [this documentation article](https://github.com/microsoft/botframework-emulator/wiki/Getting-Started) to know more about the Bot Framework Emulator.
* **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free.
* To fully test this sample you must:
* Register you bot in [Microsoft Bot Framework Portal](https://dev.botframework.com/bots). Please refer to [this](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#registering) for the instructions. Once you complete the registration, update the [Bot's Web.config](Web.config#L9-L11) file with the registered config values (Bot Id, MicrosoftAppId and MicrosoftAppPassword).
* Register you bot in [Microsoft Bot Framework Portal](https://dev.botframework.com/bots). Please refer to [this](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#registering) for the instructions. Once you complete the registration, update the [Bot's .env file](.env) file with the registered config values (MICROSOFT_APP_ID and MICROSOFT_APP_PASSWORD).
* Enable the Facebook Messenger Channel. Refer to [this](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#channels) for more information on how to configure channels.
* [Publish your bot, for example to Azure](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#publishing) or use [Ngrok to interact with your local bot in the cloud](https://blogs.msdn.microsoft.com/jamiedalton/2016/07/29/ms-bot-framework-ngrok/).

Expand All @@ -26,7 +26,7 @@ If you want to be able to take advantage of special features or concepts for a c
> NOTE: You do not need to use this feature unless you feel the need to access functionality not provided by the normal Activity.
The Facebook adapter supports sending full attachments via the [sourceEvent](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.message.html#sourceevent) method. This allows you to do anything natively that Facebook supports via the attachment schema, such as Send a check-in reminder message.
Check out [app.js](app.js#L27-L53) where a new [`AirlineCheckin`](facebook-channeldata.js#L4-L24) instance is send to the Facebook API using the channel's native construct.
Check out [app.js](app.js#L28-L54) where a new [`AirlineCheckin`](facebook-channeldata.js#L4-L24) instance is send to the Facebook API using the channel's native construct.

````JavaScript
var checkin = new FacebookDataModels.AirlineCheckin(
Expand Down
2 changes: 1 addition & 1 deletion Node/core-CreateNewConversation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The minimum prerequisites to run this sample are:

### Code Highlights

Bot Builder uses dialogs to model a conversational process, the exchange of messages, between bot and user. [bot.beginDialog()](app.js#L39) can be used to proactively start a new dialog to interact with the user.
Bot Builder uses dialogs to model a conversational process, the exchange of messages, between bot and user. [bot.beginDialog()](app.js#L42) can be used to proactively start a new dialog to interact with the user.
Because, an address is required to initiate a new conversation, this user address should be saved during any previous conversation with the user.
Any current conversation between the bot and user will be replaced with a new dialog stack.
Alternatively, [bot.send()](https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.universalbot.html#send) can be used to send a message without starting a dialog.
Expand Down
6 changes: 3 additions & 3 deletions Node/core-CustomState/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A stateless sample bot tracking context of a conversation using a custom storage

The minimum prerequisites to run this sample are:
* Latest Node.js with NPM. Download it from [here](https://nodejs.org/en/download/).
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://aka.ms/bf-bc-emulator). Please refer to [this documentation article](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#emulator) to know more about the Bot Framework Emulator.
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://emulator.botframework.com/). Please refer to [this documentation article](https://github.com/microsoft/botframework-emulator/wiki/Getting-Started) to know more about the Bot Framework Emulator.
* The Azure DocumentDB Emulator. To install the Azure DocumentDB Emulator, download it from [here](https://aka.ms/documentdb-emulator). Please refer to [this documentation article](https://docs.microsoft.com/en-us/azure/documentdb/documentdb-nosql-local-emulator) to know more about the Azure DocumentDB Emulator.
* **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free.

Expand All @@ -27,7 +27,7 @@ There might be times when a custom storage wants to be used. Reasons for wanting

This bot is based on the [State bot](../core-State), with the addition that it uses a custom storage for tracking the context of a conversation. In this case, we are storing the bot state in DocumentDB by using the [`AzureBotStorage`](https://github.com/Microsoft/BotBuilder-Azure/blob/master/Node/src/AzureBotStorage.ts) along with a [`DocumentDbClient`](https://github.com/Microsoft/BotBuilder-Azure/blob/master/Node/src/DocumentDbClient.ts) instance, both provided by the [BotBuilder Azure Extensions for Node.js](https://www.npmjs.com/package/botbuilder-azure) package.

Check out the creation of the `AzureBotStorage` and `DocumentDbClient` instances in the [app.js](./app.js#L40-L47). Also, see [how to configure the bot](./app.js#L50) to use this new custom storage:
Check out the creation of the `AzureBotStorage` and `DocumentDbClient` instances in the [app.js](./app.js#L51-L58). Also, see [how to configure the bot](./app.js#L61) to use this new custom storage:

````JavaScript
// Azure DocumentDb State Store
Expand All @@ -43,7 +43,7 @@ var botStorage = new azure.AzureBotStorage({ gzipData: false }, docDbClient);
bot.set('storage', botStorage);
````

The `DocumentDbClient` requires a few settings that can be obtained when you [create a DocumentDB account](https://docs.microsoft.com/en-us/azure/documentdb/documentdb-create-account). The sample looks for these settings in the Environment variables and, by default, is configured to use the [DocumentDB Emulator](https://docs.microsoft.com/en-us/azure/documentdb/documentdb-nosql-local-emulator). Checkout the [.env](./.env#L5-L9) file for the emulator configuration.
The `DocumentDbClient` requires a few settings that can be obtained when you [create a DocumentDB account](https://docs.microsoft.com/en-us/azure/documentdb/documentdb-create-account). The sample looks for these settings in the Environment variables and, by default, is configured to use the [DocumentDB Emulator](https://docs.microsoft.com/en-us/azure/documentdb/documentdb-nosql-local-emulator). Checkout the [.env](.env#L5-L9) file for the emulator configuration.

### Outcome

Expand Down
8 changes: 4 additions & 4 deletions Node/core-GetConversationMembers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ To do this will use the Swagger Spec file and the Swagger JS client to create a
````JavaScript
var connectorApiClient = new Swagger(
{
url: 'https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json',
url: 'https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json',
usePromise: true
});
````

Once a message is received in a group conversation, we'll ask the API for its members. In order to call the REST API, we need to be authenticated using the bot's JWT token (see [app.js - addTokenToClient function](app.js#L79-89)) and then override the API's hostname using the channel's serviceUrl (see [app.js - client.setHost](app.js#L39-L41)).
Then we call Swagger generated client (`client.Conversations.Conversations_GetConversationMembers`) and pass the response to a helper function that will print the members list to the conversation ([app.js - printMembersInChannel function](app.js#L91-L102)).
Once a message is received in a group conversation, we'll ask the API for its members. In order to call the REST API, we need to be authenticated using the bot's JWT token (see [app.js - addTokenToClient function](app.js#L82-92)) and then override the API's hostname using the channel's serviceUrl (see [app.js - client.setHost](app.js#L42-L44)).
Then we call Swagger generated client (`client.Conversations.Conversations_GetConversationMembers`) and pass the response to a helper function that will print the members list to the conversation ([app.js - printMembersInChannel function](app.js#L94-L105)).

````JavaScript
var bot = new builder.UniversalBot(connector, function (session) {
Expand Down Expand Up @@ -133,7 +133,7 @@ To get more information about how to get started in Bot Builder for Node, Conver
* [Bot Builder for Node.js Reference](https://docs.botframework.com/en-us/node/builder/overview/#navtitle)
* [ConversationUpdate event](https://docs.botframework.com/en-us/node/builder/chat-reference/interfaces/_botbuilder_d_.iconversationupdate.html)
* [Bot Connector REST API - GetConversationMembers](https://docs.botframework.com/en-us/restapi/connector/#!/Conversations/Conversations_GetConversationMembers)
* [Bot Connector REST API - Swagger file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json)
* [Bot Connector REST API - Swagger file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector.Shared/Swagger/ConnectorAPI.json)
* [Swagger-JS](https://github.com/swagger-api/swagger-js)

> **Limitations**
Expand Down
Loading

0 comments on commit 69befe5

Please sign in to comment.