Example #1
0
        public FeedbackBot(
            IFeedbackBotStateRepository stateRepository,
            ILoggerFactory loggerFactory,
            IEnumerable <IBotDialogCommand> commands,
            IEnumerable <ISurveyDefinition> surveys,
            IDialogFactory dialogFactory,
            IOptions <Features> featureToggles,
            IOptions <BotSettings> botSettings)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            this.logger = loggerFactory.CreateLogger <FeedbackBot>();

            this.dialogFactory   = dialogFactory ?? throw new ArgumentNullException(nameof(dialogFactory));
            this.stateRepository = stateRepository ?? throw new ArgumentNullException(nameof(stateRepository));
            this.commands        = commands ?? throw new ArgumentNullException(nameof(commands));
            this.surveys         = surveys ?? throw new ArgumentNullException(nameof(surveys));
            this.featureToggles  = featureToggles.Value ?? throw new ArgumentNullException(nameof(featureToggles));
            this.botSettings     = botSettings.Value ?? throw new ArgumentNullException(nameof(botSettings));

            this.Dialogs = this.BuildDialogs();
        }
 protected ComponentBuilder(
     IFeedbackBotStateRepository state,
     IOptions <FeatureToggles> features,
     IOptions <BotSettings> botSettings)
 {
     this.BotSettings = botSettings.Value ?? throw new ArgumentNullException(nameof(botSettings));
     this.Features    = features.Value ?? throw new ArgumentNullException(nameof(features));
     this.State       = state ?? throw new ArgumentNullException(nameof(state));
 }
 public SurveyEndDialogComponentBuilder(
     IFeedbackBotStateRepository state,
     IOptions <FeatureToggles> features,
     IOptions <BotSettings> botSettings,
     IFeedbackService feedbackService)
     : base(state, features, botSettings)
 {
     this.feedbackService = feedbackService;
 }
 /// <inheritdoc />
 public MultipleChoiceDialog(
     string dialogId,
     IFeedbackBotStateRepository state,
     BotSettings botSettings,
     FeatureToggles features,
     IFeedbackService feedbackService)
     : base(dialogId)
 {
     this.botSettings     = botSettings;
     this.features        = features;
     this.state           = state;
     this.feedbackService = feedbackService;
 }
        /// <inheritdoc />
        public FreeTextDialog(
            string dialogId,
            IFeedbackBotStateRepository state,
            BotSettings botSettings,
            FeatureToggles features)
            : base(dialogId)
        {
            this.InitialDialogId = dialogId;

            this.botSettings = botSettings;
            this.features    = features;
            this.state       = state;
        }
 public ExtendCommand(IFeedbackBotStateRepository state, Bot botConfiguration)
     : base("bot--state--extend", botConfiguration)
 {
     this.state = state ?? throw new ArgumentNullException(nameof(state));
 }
Example #7
0
 public OptOutCommand(IFeedbackBotStateRepository state)
     : base("stop")
 {
     this.state = state ?? throw new ArgumentNullException(nameof(state));
 }
Example #8
0
 public ActivityIdMiddleware(IFeedbackBotStateRepository feedbackBotStateRepository)
 {
     this.feedbackBotStateRepository = feedbackBotStateRepository;
 }
Example #9
0
 public ChoicePrompt(string dialogId, IFeedbackBotStateRepository stateRepository, PromptValidator <FoundChoice> validator = null, string defaultLocale = null)
     : base(dialogId, validator, defaultLocale)
 {
     this.stateRepository = stateRepository;
 }
Example #10
0
 public StartDialogCommand(IFeedbackBotStateRepository state, BotConfiguration botConfiguration)
     : base("bot--dialog--start", botConfiguration)
 {
     this.state = state ?? throw new ArgumentNullException(nameof(state));
 }
 public FreeTextDialogComponentBuilder(IFeedbackBotStateRepository state, IOptions <Features> features, IOptions <Bot> botSettings)
     : base(state, features, botSettings)
 {
 }
 public MultipleChoiceDialogComponentBuilder(IFeedbackBotStateRepository state, IOptions <Features> features, IOptions <Bot> botSettings, IFeedbackService feedbackService)
     : base(state, features, botSettings)
 {
     this.feedbackService = feedbackService;
 }
Example #13
0
 public SmsMessageQueue(ISmsQueueProvider smsQueueProvider, IOptions <Notify> notifyConfigOptions, IFeedbackBotStateRepository feedbackBotStateRepository)
 {
     this.notifyConfig               = notifyConfigOptions.Value;
     this.smsQueueProvider           = smsQueueProvider;
     this.feedbackBotStateRepository = feedbackBotStateRepository;
 }
Example #14
0
 public TurnIdMiddleware(IFeedbackBotStateRepository feedbackBotStateRepository)
 {
     this.feedbackBotStateRepository = feedbackBotStateRepository;
 }
Example #15
0
 public ResetDialogCommand(IFeedbackBotStateRepository state, BotConfiguration botConfiguration)
     : base("bot--state--reset", botConfiguration)
 {
     this.state = state;
 }