Skip to content

Commit

Permalink
Merge branch 'master' into fixdelete
Browse files Browse the repository at this point in the history
  • Loading branch information
boydc2014 authored Mar 17, 2020
2 parents 9d0ae7f + 7e53610 commit 6d383b1
Show file tree
Hide file tree
Showing 22 changed files with 1,155 additions and 307 deletions.
21 changes: 11 additions & 10 deletions BotProject/Templates/CSharp/BotProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
<CodeAnalysisRuleSet>BotProject.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Debugging" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.8.0-preview-200227-109209" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.ApplicationInsights" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Azure" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive" Version="4.8.0-rc5-preview" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Debugging" Version="4.8.0-rc5-preview" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Declarative" Version="4.8.0-rc5-preview" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.8.0" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.8.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PrivateAssets>all</PrivateAssets>
Expand Down
8 changes: 5 additions & 3 deletions BotProject/Templates/CSharp/ComposerBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Bot.Builder.Dialogs.Debugging;
using Microsoft.Bot.Builder.Dialogs.Declarative;
using Microsoft.Bot.Builder.Dialogs.Declarative.Resources;
using Microsoft.Bot.Builder.Skills;

namespace Microsoft.Bot.Builder.ComposerBot.Json
{
Expand All @@ -22,14 +23,15 @@ public class ComposerBot : ActivityHandler
private readonly ISourceMap sourceMap;
private readonly string rootDialogFile;

public ComposerBot(string rootDialogFile, ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, ISourceMap sourceMap)
public ComposerBot(ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, BotFrameworkClient skillClient, SkillConversationIdFactoryBase conversationIdFactory)
{
HostContext.Current.Set(skillClient);
HostContext.Current.Set(conversationIdFactory);
this.conversationState = conversationState;
this.userState = userState;
this.dialogState = conversationState.CreateProperty<DialogState>("DialogState");
this.sourceMap = sourceMap;
this.resourceExplorer = resourceExplorer;
this.rootDialogFile = rootDialogFile;
this.rootDialogFile = "Main.dialog";
LoadRootDialogAsync();
}

Expand Down
52 changes: 52 additions & 0 deletions BotProject/Templates/CSharp/Controllers/SkillController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Schema;

namespace Microsoft.Bot.Builder.TestBot.Json.Controllers
{
/// <summary>
/// A controller that handles skill replies to the bot.
/// This example uses the <see cref="SkillHandler"/> that is registered as a <see cref="ChannelServiceHandler"/> in startup.cs.
/// </summary>
[ApiController]
[Route("api/skills")]
public class SkillController : ChannelServiceController
{
public SkillController(ChannelServiceHandler handler)
: base(handler)
{
}

public override Task<IActionResult> ReplyToActivityAsync(string conversationId, string activityId, Activity activity)
{
try
{
return base.ReplyToActivityAsync(conversationId, activityId, activity);
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}

public override Task<IActionResult> SendToConversationAsync(string conversationId, Activity activity)
{
try
{
return base.SendToConversationAsync(conversationId, activity);
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
}
}
}
Loading

0 comments on commit 6d383b1

Please sign in to comment.