-
Notifications
You must be signed in to change notification settings - Fork 1
/
GreetingsIntent.cs
40 lines (38 loc) · 1.23 KB
/
GreetingsIntent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace sample.Areas
{
using System.Threading;
using System.Threading.Tasks;
using Zyin.IntentBot.Intent;
using Microsoft.Bot.Builder;
/// <summary>
/// Intent context for greetings
/// </summary>
public class GreetingsContext : IntentContext
{
/// <summary>
/// Gets the intent name
/// </summary>
public override string IntentName => SampleIntentService.Intent_Greetings;
}
/// <summary>
/// Handler to process greetings intent
/// </summary>
public class GreetingsIntentHandler : IntentHandler<GreetingsContext>
{
/// <summary>
/// Process the greetings request
/// </summary>
/// <param name="turnContext"></param>
/// <param name="intentContext"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
protected override async Task ProcessIntentInternalAsync(
ITurnContext turnContext,
GreetingsContext intentContext,
CancellationToken cancellationToken)
{
var msg = "Hi there. What can I do for you?";
await turnContext.SendActivityAsync(MessageFactory.Text(msg), cancellationToken);
}
}
}