Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

CreateNewConversationDialog.cs 1.0 KB

You have to be logged in to leave a comment. Sign In
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
  1. namespace CreateNewConversationBot
  2. {
  3. using System;
  4. using System.Threading.Tasks;
  5. using Microsoft.Bot.Builder.Dialogs;
  6. using Microsoft.Bot.Builder.Internals.Fibers;
  7. using Microsoft.Bot.Connector;
  8. [Serializable]
  9. public class CreateNewConversationDialog : IDialog<object>
  10. {
  11. private readonly ISurveyService surveyService;
  12. public CreateNewConversationDialog(ISurveyService surveyService)
  13. {
  14. SetField.NotNull(out this.surveyService, nameof(surveyService), surveyService);
  15. }
  16. public async Task StartAsync(IDialogContext context)
  17. {
  18. context.Wait(this.MessageReceivedAsync);
  19. }
  20. public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> result)
  21. {
  22. await context.PostAsync("You've been invited to a survey! It will start in a few seconds...");
  23. await this.surveyService.QueueSurveyAsync();
  24. context.Wait(this.MessageReceivedAsync);
  25. }
  26. }
  27. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...