Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
49fb298
Release 07-07-2017 (#176)
RobStand Jul 7, 2017
0973c43
Sync with live for 7-7-17 release
RobStand Jul 7, 2017
12646e6
ISO 639-2 recommends use of the language codes in lower case (#175)
johnd-ms Jul 8, 2017
926f3c4
Update bot-builder-dotnet-quickstart.md
brandonh-msft Jul 6, 2017
d0cd730
Removing bad metadata (#183)
Jul 14, 2017
ac1c2eb
Release 07-14-2017 (#184)
Jul 14, 2017
010b980
Conversation designer (#178)
v-ducvo Jul 14, 2017
1e3591f
Conversation Designer going live (#188)
Jul 14, 2017
574e013
requires (#186)
johnd-ms Jul 14, 2017
1ce3e76
Merge branch 'master' into live
RobStand Jul 14, 2017
6f6c2c2
Dialog next steps (#177)
v-ducvo Jul 20, 2017
9743606
Release 7-20-2017
RobStand Jul 20, 2017
3361cd6
Sync for release
RobStand Jul 20, 2017
8d30028
Subscribe to bot events, always show bot online (#189)
johnd-ms Jul 20, 2017
ec98458
Changing author alias (#193)
RobStand Jul 20, 2017
b4ec305
links to best current samples, User Story 17067 (#185)
johnd-ms Jul 20, 2017
6c0f28c
Second effort for PR181 (#187)
johnd-ms Jul 20, 2017
9370c54
Groupme screencaps (#191)
johnd-ms Jul 20, 2017
6de5e70
Updates to Slack, GroupMe, sample links, next steps (#194)
Jul 20, 2017
2c3143e
Fixed broken anchor links from table to section in topic. (#195)
v-ducvo Jul 21, 2017
36215da
Adding NoIndex, NoFollow to metadata (#196)
RobStand Jul 24, 2017
2ba2d36
Merge branch 'live' into master
RobStand Jul 24, 2017
5d966b7
Release 7-24-2017 (#197)
RobStand Jul 24, 2017
df7db59
Merge branch 'live'
RobStand Jul 24, 2017
27620f9
Removing broken video
RobStand Jul 26, 2017
88128b2
Update bot-builder-nodejs-cortana-skill.md
Jul 28, 2017
b7400f1
Update bot-builder-nodejs-cortana-skill.md (#198)
Jul 28, 2017
79f5dd8
added dotnet scorable dialogs (#180)
matthewshim-ms Jul 28, 2017
07aafb8
Merge branch 'live' into master
Jul 28, 2017
bf01cb8
Update filenames.md
RobStand Jul 28, 2017
9f42eca
Added entries about the documentation (#206)
RobStand Jul 31, 2017
23fa10d
Slack review (#204)
johnd-ms Aug 1, 2017
229e7ef
Scorable review (#203)
Aug 1, 2017
34ad2cf
Grammar correction. Whose, not Who's (#33)
Jul 24, 2017
3a6f112
Updated to correct version of IISExpress (#35)
deankroker Jul 31, 2017
ab17c93
Update resources-tools-downloads.md (#31)
mschray Aug 1, 2017
2fc82cc
Changed AttachmentLayouts to AttachmentLayoutTypes (#38)
peterkaplan Aug 1, 2017
be39fd3
Release 08-01-2017 (#207)
RobStand Aug 1, 2017
b979a3b
Updating next step
RobStand Aug 1, 2017
0b6fc95
Fixing illegal bookmark usage
RobStand Aug 1, 2017
53a0d6f
Fixing build warning in dotnet reference
RobStand Aug 1, 2017
c1fc1a8
Fixing build warning in dotnet reference
RobStand Aug 1, 2017
346bb26
Staging for fix from nuget release
RobStand Aug 1, 2017
a87b3e1
Cropped out wechat icon. wechat is not supported (#209)
RobStand Aug 2, 2017
f65fd93
Merge branch 'master' into live
RobStand Aug 2, 2017
8334a16
three downloads for one template (#212)
johnd-ms Aug 2, 2017
886333d
Initialize open publishing repository: https://github.com/MicrosoftDo…
RobStand Aug 2, 2017
e65b0ca
Initialize open publishing repository: https://github.com/MicrosoftDo…
RobStand Aug 2, 2017
46db002
Fix for bug# 17564. Add gitter.im, specifically the BotBuilder ROOM (…
johnd-ms Aug 3, 2017
22b7e60
Merge branch 'live' into master
RobStand Aug 3, 2017
998faaa
Release 08-03-2017 (#217)
RobStand Aug 3, 2017
b9e944b
Sync live with master for release
RobStand Aug 3, 2017
0748ceb
17561 deploy from local git (#215)
johnd-ms Aug 4, 2017
b2005b8
add ms.date metadata (#219)
Aug 4, 2017
44e9b64
Fixing search scope
RobStand Aug 5, 2017
20d2a36
Release 08-04-2017 (#221)
RobStand Aug 5, 2017
1a9969c
Merge branch 'live' into master
RobStand Aug 5, 2017
83cbd9c
# 17767: shorten titles to 80 chars for SEO (#220)
Aug 5, 2017
722d5a5
Community content (#223)
RobStand Aug 7, 2017
159b9b1
Configure PDF builds.
Aug 7, 2017
e74c9e5
Update .openpublishing.publish.config.json
Aug 7, 2017
a3b598a
Merge pull request #225 from MicrosoftDocs/master
Aug 7, 2017
91332fb
Merge branch 'live' into live-sync-work
RobStand Aug 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Release 08-01-2017 (#207)
  • Loading branch information
RobStand authored Aug 1, 2017
commit be39fd31c2932cec779a37468f4b67400f94e402
1 change: 1 addition & 0 deletions articles/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#### [Dialogs overview](~/dotnet/bot-builder-dotnet-dialogs.md)
#### [Manage conversation flow](~/dotnet/bot-builder-dotnet-manage-conversation-flow.md)
#### [Enable language understanding](~/dotnet/bot-builder-dotnet-luis-dialogs.md)
#### [Scorable dialogs](~/dotnet/bot-builder-dotnet-scorable-dialogs.md)
### FormFlow
#### [Basic features of FormFlow](~/dotnet/bot-builder-dotnet-formflow.md)
#### [Advanced features of FormFlow](~/dotnet/bot-builder-dotnet-formflow-advanced.md)
Expand Down
26 changes: 15 additions & 11 deletions articles/channel-connect-slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ms.author: rstand
manager: tomlm
ms.topic: article
ms.prod: bot-framework
ms.date: 06/12/2017
ms.date: 07/31/2017
---

# Connect a bot to Slack

You can configure your bot to communicate with people using the Slack messaging app.

## Log in to Slack and create a Slack Application for your bot
## Create a Slack Application for your bot

Log into Slack and [create a Slack application](https://api.slack.com/applications/new).

Expand Down Expand Up @@ -41,7 +41,12 @@ Next you will add a new Redirect URL.

## Subscribe to Bot Events

By subscribing to bot events, your app will be notified of user activities at the URL you specify.
Follow these steps to subscribe to six particular bot events. By subscribing to bot events, your app will be notified of user activities at the URL you specify.

> [!TIP]
> Your bot handle is a property of your bot. To find a bot's handle,
> visit [https://dev.botframework.com/bots](https://dev.botframework.com/bots),
> choose a bot, and click **SETTINGS**.

1. Select the **Event Subscriptions** tab.
2. Click **Enable Events** to **On**.
Expand Down Expand Up @@ -74,10 +79,11 @@ Click **Add Bot User** to validate your settings, click **Always Show My Bot as

## Add and Configure Interactive Messages (optional)

If your bot will use Slack-specific functionality such as buttons, select the **Interactive Messages** tab and click **Enable Interactive Messages**.
If your bot will use Slack-specific functionality such as buttons, follow these steps:

1. Enter https://slack.botframework.com/api/Actions as the Request URL for Interactive Messages.
2. Click the **Enable Interactive Messages** button and **Save changes** once the URL is successfully validated.
1. Select the **Interactive Messages** tab and click **Enable Interactive Messages**.
2. Enter https://slack.botframework.com/api/Actions as the **Request URL**.
3. Click the **Enable Interactive Messages** button, and then click the **Save changes** button.

![Enable messages](~/media/channels/slack-MessageURL.png)

Expand All @@ -92,15 +98,13 @@ In a separate browser window, return to the Bot Framework site at http://dev.bot

1. Select **My bots** and choose the Bot that you want to connect to Slack.
2. In the **Add a channel** section, click the Slack icon.
3. In the **Submit your Credentials** section, paste the App Credentials from the Slack website into the appropriate fields.
3. In the **Enter your Slack credentials** section, paste the App Credentials from the Slack website into the appropriate fields.
4. The **Landing Page URL** is optional. You may remove or change it.
5. Click **Submit Slack Credentials**.
5. Click **Save**.

![Submit credentials](~/media/channels/slack-SubmitCredentials.png)

Follow the instructions to authorize your Slack app's access to your Development Slack Team.

## Enable the bot
Check **Enable this bot on Slack**. Then click **I'm done configuring Slack**.

When you have completed these steps, your bot will be successfully configured to communicate with users in Slack.
On the Configure Slack page, confirm the slider by the Save button is set to **Enabled**. Your bot is configured to communicate with users in Slack.
2 changes: 1 addition & 1 deletion articles/dotnet/bot-builder-dotnet-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Next, open Visual Studio and create a new C# project. Choose the Bot Application
![Visual Studio create project](../media/connector-getstarted-create-project.png)

> [!NOTE]
> Visual Studio might say you need to [download and install IIS Express](https://www.microsoft.com/en-us/download/details.aspx?id=1038).
> Visual Studio might say you need to [download and install IIS Express](https://www.microsoft.com/en-us/download/details.aspx?id=48264).


By using the Bot Application template, you're creating a project that already contains all of the
Expand Down
160 changes: 160 additions & 0 deletions articles/dotnet/bot-builder-dotnet-scorable-dialogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
title: Global message handlers using scorables
description: Create more flexible dialogs using scorables within the Bot Builder SDK for .NET.
author: matthewshim-ms
ms.author: v-shimma
manager: rstand
ms.topic: article
ms.prod: bot-framework
ms.date: 07/12/2017
---
# Global message handlers using scorables

Users attempt to access certain functionality within a bot by using words like "help," "cancel," or "start over" in the middle of a conversation when the bot is expecting a different response. You can design your bot to gracefully handle such requests using scorable dialogs.

Scorable dialogs monitor all incoming messages and determine whether a message is actionable in some way. Messages that are scorable are assigned a score between [0 – 1] by each scorable dialog. The scorable dialog that determines the highest score is added to the top of the dialog stack and then hands the response to the user. After the scorable dialog completes execution, the conversation continues from where it left off.

Scorables enable you to create more flexible conversations by allowing your users to 'interrupt' the normal conversation flow you find in regular dialogs.

## Create a scorable dialog

First, define a new [dialog](bot-builder-dotnet-dialogs.md). The following code uses a dialog that is derived from the `IDialog` interface.

```cs
public class SampleDialog : IDialog<object>
{
public async Task StartAsync(IDialogContext context)
{
await context.PostAsync("This is a Sample Dialog which is Scorable. Reply with anything to return to the prior prior dialog.");

context.Wait(this.MessageReceived);
}

private async Task MessageReceived(IDialogContext context, IAwaitable<IMessageActivity> result)
{
var message = await result;

if ((message.Text != null) && (message.Text.Trim().Length > 0))
{
context.Done<object>(null);
}
else
{
context.Fail(new Exception("Message was not a string or was an empty string."));
}
}
}
```
To make a scorable dialog, create a class that inherits from the `ScorableBase` abstract class. The following code shows a `SampleScorable` class.

```cs
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Internals;
using Microsoft.Bot.Builder.Internals.Fibers;
using Microsoft.Bot.Builder.Scorables.Internals;

public class SampleScorable : ScorableBase<IActivity, string, double>
{
private readonly IDialogTask task;

public SampleScorable(IDialogTask task)
{
SetField.NotNull(out this.task, nameof(task), task);
}
}
```
The `ScorableBase` abstract class inherits from the `IScorable` interface. You will need to implement the following `IScorable` methods in your class:

- `PrepareAsync` is the first method that is called in the scorable instance. It accepts incoming message activity, analyzes and sets the dialog's state, which is passed to all the other methods of the `IScorable` interface.

```cs
protected override async Task<string> PrepareAsync(IActivity item, CancellationToken token)
{
// TODO: insert your code here
}
```

- The `HasScore` method checks the state property to determine if the scorable dialog should provide a score for the message. If it returns false, the message will be ignored by the scorable dialog.

```cs
protected override bool HasScore(IActivity item, string state)
{
// TODO: insert your code here
}
```

- `GetScore` will only trigger if `HasScore` returns true. You’ll provision the logic in this method to determine the score for a message between 0 - 1.

```cs
protected override double GetScore(IActivity item, string state)
{
// TODO: insert your code here
}
```
- In the `PostAsync` method, define core actions to be performed for the scorable class. All scorable dialogs will monitor incoming messages, and assign scores to valid messages based on the scorables' GetScore method. The scorable class which determines the highest score (between 0 - 1.0) will then trigger that scorable's `PostAsync` method.

```cs
protected override Task PostAsync(IActivity item, string state, CancellationToken token)
{
//TODO: insert your code here
}
```

- `DoneAsync` is called after the scoring process is complete. Use this method to dispose of any scoped resources.

```cs
protected override Task DoneAsync(IActivity item, string state, CancellationToken token)
{
//TODO: insert your code here
}
```

## Create a module to register the IScorable service

Next, define a `Module` that will register the `SampleScorable` class as a component. This will provision the `IScorable` service.

```cs
public class GlobalMessageHandlersBotModule : Module
{
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);

builder
.Register(c => new SampleScorable(c.Resolve<IDialogTask>()))
.As<IScorable<IActivity, double>>()
.InstancePerLifetimeScope();
}
}
```
## Register the module

The last step in the process is to apply the `SampleScorable` to the bot's Conversation Container. This will register the scorable service within the Bot Framework's message handling pipeline. The following code shows to update the `Conversation.Container` within the bot app's initialization in **Global.asax.cs**:

```cs
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
this.RegisterBotModules();
GlobalConfiguration.Configure(WebApiConfig.Register);
}

private void RegisterBotModules()
{
var builder = new ContainerBuilder();
builder.RegisterModule(new ReflectionSurrogateModule());

//Register the module within the Conversation container
builder.RegisterModule<GlobalMessageHandlersBotModule>();

builder.Update(Conversation.Container);
}
}
```

## Additional resources
* [Global Message Handlers sample](https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-GlobalMessageHandlers)
* [Simple Scorable Bot sample](https://github.com/Microsoft/BotFramework-Samples/tree/master/CSharp/ScorableBotSample)
* [Dialogs overview](bot-builder-dotnet-dialogs.md)
* [AutoFac](https://autofac.org/)
6 changes: 3 additions & 3 deletions articles/includes/code/dotnet-add-attachments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// <addHeroCardAttachment>
Activity replyToConversation = message.CreateReply("Should go to conversation, in carousel format");
replyToConversation.AttachmentLayout = AttachmentLayouts.Carousel;
replyToConversation.AttachmentLayout = AttachmentLayoutTypes.Carousel;
replyToConversation.Attachments = new List<Attachment>();

Dictionary<string, string> cardContentList = new Dictionary<string, string>();
Expand Down Expand Up @@ -54,7 +54,7 @@

// <addThumbnailCardAttachment>
Activity replyToConversation = message.CreateReply("Should go to conversation, in list format");
replyToConversation.AttachmentLayout = AttachmentLayouts.List;
replyToConversation.AttachmentLayout = AttachmentLayoutTypes.List;
replyToConversation.Attachments = new List<Attachment>();

Dictionary<string, string> cardContentList = new Dictionary<string, string>();
Expand Down Expand Up @@ -251,4 +251,4 @@
replyToConversation.Attachments.Add(attachment);

var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
// </addAdaptiveCardAttachment>
// </addAdaptiveCardAttachment>
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var bot = new builder.UniversalBot(connector, [
},
function (session, results) {
session.dialogData.partySize = results.response;
builder.Prompts.text(session, "Who's name will this reservation be under?");
builder.Prompts.text(session, "Whose name will this reservation be under?");
},
function (session, results) {
session.dialogData.reservationName = results.response;
Expand Down
6 changes: 4 additions & 2 deletions articles/resources-links-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ms.author: rstand
manager: rstand
ms.topic: article
ms.prod: bot-framework
ms.date: 06/12/2017
ms.date: 07/31/2017
---

# Bot Framework additional resources
Expand All @@ -22,4 +22,6 @@ These resources provide additional information and support for developing bots w
|**Community support** | [StackOverflow](https://stackoverflow.com/questions/tagged/botframework)
|**Using a bot** | Contact the bot's developer through their publisher e-mail
|**Bot Builder SDK issues/suggestions**| Use the issues tab on the <a href="https://github.com/Microsoft/BotBuilder/" target="_blank">GitHub repo</a>
|**Reporting Abuse**| Contact us at [[email protected]](mailto://[email protected])
|**Documentation issues**| Submit an <a href="https://github.com/Microsoft/bot-framework-docs/issues" target="_blank">issue</a> to the Bot Framework documentation GitHub repo.
|**Documentation updates**| Click the Edit link on an article and submit a pull request to the <a href="https://github.com/Microsoft/bot-framework-docs" target="_blank">Bot Framework documentation GitHub repo</a>.
|**Reporting abuse**| Contact us at [[email protected]](mailto://[email protected])
3 changes: 3 additions & 0 deletions articles/resources-tools-downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Download Visual Studio project templates to accelerate bot development.
* [Bot template for Visual Studio][bot-template] for developing bots with C#
* [Cortana skill template for Visual Studio][cortana-template] for developing Cortana skills with C#

> [!TIP]
> <a href="https://docs.microsoft.com/en-us/visualstudio/ide/how-to-locate-and-organize-project-and-item-templates" target="_blank">Learn more</a> about how to install Visual Studio 2017 project templates.

## Bot Builder SDK for Node.js
The Bot Builder SDK for Node.js provides a familiar way for Node.js developers to write bots. You can use it to build a wide variety of conversational user interfaces, from simple prompts to free-form conversations. The Bot Builder SDK for Node.js uses restify, a popular framework for building web services, to create the bot's web server. The SDK is also compatible with Express.

Expand Down
8 changes: 4 additions & 4 deletions styleguide/filenames.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ URLs must be consistent, hierarchical, and as shallow as possible to perform wel
To ensure well-structured URLs, use one of following URL patterns:


https://docs.microsoft.com/en-us/botframework/{technology}/{filename}
https://docs.microsoft.com/en-us/bot-framework/{technology}/{filename}

https://docs.microsoft.com/en-us/botframework/{technology}/{userjourney-or-secondary-category}/{filename}
https://docs.microsoft.com/en-us/bot-framework/{technology}/{userjourney-or-secondary-category}/{filename}
Use this option if the content set is large and requires deeper hierarchies.

>[!IMPORTANT]
Expand All @@ -34,5 +34,5 @@ You may use industry-standard acronyms or abbreviations, such as DNS or URL. .

Here are examples of descriptive, relevant file names:

conversations-control-templates.md
install-botbuilder-sdk.md
bot-builder-dotnet-conversations-control-templates.md
resources-install-botbuilder-sdk.md