Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 324d2be

Browse files
committed
updated skill template
1 parent 3298c00 commit 324d2be

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

templates/csharp/Skill/Skill.Tests/SkillTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public string[] GetTemplates(string name, object data = null)
129129
Path.Combine(".", "Responses", $"AllResponses.lg") :
130130
Path.Combine(".", "Responses", $"AllResponses.{CultureInfo.CurrentUICulture.Name.ToLower()}.lg");
131131

132-
return Templates.ParseFile(path).ExpandTemplate(name, data).ToArray();
132+
return Templates.ParseFile(path).ExpandTemplate(name, data).Cast<string>().ToArray();
133133
}
134134
}
135135
}

templates/csharp/Skill/Skill/Bots/DefaultActivityHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading.Tasks;
88
using Microsoft.Bot.Builder;
99
using Microsoft.Bot.Builder.Dialogs;
10+
using Microsoft.Bot.Connector;
1011
using Microsoft.Bot.Schema;
1112
using Microsoft.Bot.Solutions.Responses;
1213
using Microsoft.Extensions.DependencyInjection;
@@ -49,6 +50,13 @@ protected override async Task OnMembersAddedAsync(IList<ChannelAccount> membersA
4950

5051
protected override Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
5152
{
53+
// directline speech occasionally sends empty message activities that should be ignored
54+
var activity = turnContext.Activity;
55+
if (activity.ChannelId == Channels.DirectlineSpeech && activity.Type == ActivityTypes.Message && string.IsNullOrEmpty(activity.Text))
56+
{
57+
return Task.CompletedTask;
58+
}
59+
5260
return _dialog.RunAsync(turnContext, _dialogStateAccessor, cancellationToken);
5361
}
5462

templates/csharp/Skill/Skill/Deployment/Scripts/deploy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ if ($parametersFile) {
234234
--parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" luisAuthoringLocation=$armLuisAuthoringRegion useLuisAuthoring=$createLuisAuthoring `
235235
--output json `
236236
2>&1 `
237-
| Tee-Object -FilePath $logFile -OutVariable validation
237+
| Tee-Object -FilePath $logFile -OutVariable validation `
238238
| Out-Null
239239

240240
# OutVariable always outputs the contents of the piped output stream as System.Collections.ArrayList, so now let's parse into
@@ -279,7 +279,7 @@ else {
279279
--parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" luisAuthoringLocation=$armLuisAuthoringRegion useLuisAuthoring=$createLuisAuthoring `
280280
--output json `
281281
2>&1 `
282-
| Tee-Object -FilePath $logFile -OutVariable validation
282+
| Tee-Object -FilePath $logFile -OutVariable validation `
283283
| Out-Null
284284

285285
# OutVariable always outputs the contents of the piped output stream as System.Collections.ArrayList, so now let's parse into

templates/csharp/Skill/Skill/Dialogs/MainDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ private async Task<DialogTurnResult> RouteStepAsync(WaterfallStepContext stepCon
215215

216216
switch (intent)
217217
{
218-
case $safeprojectname$Luis.Intent.Sample:
218+
case $safeprojectname$Luis.Intent.Sample:
219219
{
220-
return await stepContext.BeginDialogAsync(_sampleDialog.Id, cancellationToken: cancellationToken);
220+
return await stepContext.BeginDialogAsync(_sampleDialog.Id, cancellationToken: cancellationToken);
221221
}
222222

223-
case $safeprojectname$Luis.Intent.None:
223+
case $safeprojectname$Luis.Intent.None:
224224
default:
225225
{
226226
// intent was identified but not yet implemented

templates/csharp/Skill/Skill/Responses/MainResponses.lg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
[HeroCard
6363
title= ${HelpTitle()}
6464
subtitle= ${HelpSubtitle()}
65+
speak = ${HelpSubtitle()}
6566
]
6667

6768

templates/csharp/Skill/Skill/Skill.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
1010
<PackageReference Include="Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" />
1111
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language" Version="1.0.1-preview" />
12-
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.8.1" />
13-
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.8.1" />
14-
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.8.1" />
15-
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.8.1" />
16-
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.8.1" />
17-
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.8.1" />
12+
<PackageReference Include="Microsoft.Bot.Builder.AI.Luis" Version="4.9.1" />
13+
<PackageReference Include="Microsoft.Bot.Builder.AI.QnA" Version="4.9.1" />
14+
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.9.1" />
15+
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.9.1" />
16+
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.9.1" />
17+
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.9.1" />
1818
<PackageReference Include="Microsoft.Bot.Solutions" Version="1.0.0" />
1919
</ItemGroup>
2020

0 commit comments

Comments
 (0)