forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupportDialog.cs
More file actions
27 lines (22 loc) · 793 Bytes
/
SupportDialog.cs
File metadata and controls
27 lines (22 loc) · 793 Bytes
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
namespace MultiDialogsBot.Dialogs
{
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
[Serializable]
public class SupportDialog : IDialog<int>
{
public async Task StartAsync(IDialogContext context)
{
context.Wait(this.MessageReceivedAsync);
}
public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> result)
{
var message = await result;
var ticketNumber = new Random().Next(0, 20000);
await context.PostAsync($"Your message '{message.Text}' was registered. Once we resolve it; we will get back to you.");
context.Done(ticketNumber);
}
}
}