Exemple #1
0
        // Dependency injection uses this constructor to instantiate MainDialog
        public MainBastardDialog(BastardRecognizer luisRecognizer, ILogger <MainBastardDialog> logger,
                                 IBotServices botBervices, IServiceScopeFactory scopeFactory, DIBastardBrain brain,
                                 IMemoryCache memoryCache)
            : base(nameof(MainBastardDialog))
        {
            _luisRecognizer = luisRecognizer;
            _botServices    = botBervices;
            _brain          = brain;
            Logger          = logger;
            _cache          = memoryCache;

            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                ShowConditions,
                CheckAccepted,
                IntroStepAsync,
                ActStepAsync,
                ShowQnAInsultAndGetAnother,
                GoRoundAgain
            }));
            AddDialog(new NewInsultQnADialog(brain));
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            // The initial child Dialog to run.
            InitialDialogId = nameof(WaterfallDialog);
        }
Exemple #2
0
 public NewInsultQnADialog(BastardBrain brain) : base(nameof(NewInsultQnADialog))
 {
     _brain = brain;
     AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
     {
         NewInsult,
         PromptReplyToInsult,
         AddInsultResponse,
         MoreResponses,
         ConfirmNewInsultQnA
     }));
     AddDialog(new TextPrompt(nameof(TextPrompt), InsultResponseValidator));
     AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
     AddDialog(new AddMoreInsultsForResponseDialog(_brain.GetBastardDBContext()));
 }