Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // 01. Root Dialog
  2. var bot = new builder.UniversalBot(connector,
  3. function (session) {
  4. // echo the user's message
  5. session.send("You said: %s", session.message.text);
  6. }
  7. );
  8.  
  9. // 01. Root Dialog
  10. var bot = new builder.UniversalBot(connector, [
  11. (session, args, next) => {...},
  12. (session, results, next) =>{...}
  13. ]);
  14.  
  15.  
  16. // 01. Root Dialog
  17.  
  18. var bot = new builder.UniversalBot(connector);
  19.  
  20. bot.dialog('/', function (session) {
  21. session.send('Hello World');
  22. });
  23.  
  24.  
  25. // 01. Root Dialog
  26.  
  27. var bot = new builder.UniversalBot(connector);
  28.  
  29. bot.dialog('/', [
  30. function( session ) {
  31. builder.Prompts.text(session, "blah blah blah?");
  32. },
  33. function( session, results ) {
  34. // ...
  35.  
  36. session.beginDialog('/foo');
  37. session.endDialog();
  38. }
  39. ]);
  40.  
  41. //02. maxRetries syntax
  42.  
  43. builder.Prompts.choice(session, "Please select : ", "Cat|Dog|Fox",
  44. {
  45. listStyle: builder.ListStyle.button,
  46. maxRetries: 2,
  47. retryPrompt:'Please Provide invoice no'
  48. })
  49.  
  50. //03. Random retry prompt
  51.  
  52. builder.Prompts.choice(
  53. session,
  54. 'This is just a random question?',
  55. 'Yes|No',
  56. { retryPrompt: randomRetry() }
  57. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement