forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelpDialog.cs
40 lines (34 loc) · 1.25 KB
/
HelpDialog.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 RollerSkillBot.Dialogs
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using RollerSkillBot.Properties;
[Serializable]
public class HelpDialog : IDialog<object>
{
private const string RollDiceOptionValue = "roll some dice";
private const string PlayCrapsOptionValue = "play craps";
public async Task StartAsync(IDialogContext context)
{
var message = context.MakeMessage();
message.Speak = SSMLHelper.Speak(Resources.HelpSSML);
message.InputHint = InputHints.AcceptingInput;
message.Attachments = new List<Attachment>
{
new HeroCard(Resources.HelpTitle)
{
Buttons = new List<CardAction>
{
new CardAction(ActionTypes.ImBack, "Roll Dice", value: RollDiceOptionValue),
new CardAction(ActionTypes.ImBack, "Play Craps", value: PlayCrapsOptionValue)
}
}.ToAttachment()
};
await context.PostAsync(message);
context.Done<object>(null);
}
}
}