-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fixdelete
- Loading branch information
Showing
22 changed files
with
1,155 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
BotProject/Templates/CSharp/Controllers/SkillController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.