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

SettingsDialog.cs 942 B

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
  1. namespace GlobalMessageHandlersBot.Dialogs
  2. {
  3. using Microsoft.Bot.Builder.Dialogs;
  4. using System;
  5. using System.Threading.Tasks;
  6. using Microsoft.Bot.Connector;
  7. public class SettingsDialog : IDialog<object>
  8. {
  9. public async Task StartAsync(IDialogContext context)
  10. {
  11. await context.PostAsync("This is the Settings Dialog. Reply with anything to return to prior dialog.");
  12. context.Wait(this.MessageReceived);
  13. }
  14. private async Task MessageReceived(IDialogContext context, IAwaitable<IMessageActivity> result)
  15. {
  16. var message = await result;
  17. if ((message.Text != null) && (message.Text.Trim().Length > 0))
  18. {
  19. context.Done<object>(null);
  20. }
  21. else
  22. {
  23. context.Fail(new Exception("Message was not a string or was an empty string."));
  24. }
  25. }
  26. }
  27. }
Tip!

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

Comments

Loading...