コード例 #1
0
 public ViewDeathCommand(IEventBus eventBus, ITwitchApiWrapper twitchApiWrapper, IConfigurationManager configurationManager, ILogger logger)
 {
     this.eventBus             = eventBus;
     this.twitchApiWrapper     = twitchApiWrapper;
     this.configurationManager = configurationManager;
     this.logger = logger;
 }
コード例 #2
0
 public TwitchInterfaceWorker(IEventBus bus, ITwitchClientWrapper clientWrapper, ITwitchApiWrapper apiWrapper, ILogger logger, IConfigurationManager configurationManager)
 {
     this.bus                  = bus;
     this.clientWrapper        = clientWrapper;
     this.apiWrapper           = apiWrapper;
     this.logger               = logger.ForContext <TwitchInterfaceWorker>();
     this.configurationManager = configurationManager;
 }
コード例 #3
0
 public IncreaseDeathCommand(
     IEventBus eventBus,
     IConfigurationManager configurationManager,
     ITwitchApiWrapper twitchApiWrapper,
     ILogger logger)
 {
     this.eventBus             = eventBus;
     this.configurationManager = configurationManager;
     this.twitchApiWrapper     = twitchApiWrapper;
     this.logger = logger.ForContext <IncreaseDeathCommand>();
 }
コード例 #4
0
        public static IMediator Build(ITwitchClient twitchClient           = null,
                                      ITwitchApiWrapper twitchApiWrapper   = null,
                                      ITwitchBucketProvider bucketProvider = null,
                                      IKeyGenerator keyGenerator           = null,
                                      IHubContext <ChatWebPageHub, IChatWebPageHub> hubContext = null,
                                      IConfiguration configuration = null)
        {
            var services = new ServiceCollection();

            services.AddMediatR(Assembly.GetAssembly(typeof(MattsChatBotHostedService)));

            services.AddTransient <TwitchCommandRequestFactory>();
            services.AddSingleton <ITwitchClient>(twitchClient ?? new Mock <ITwitchClient>().Object);
            services.AddSingleton <ITwitchApiWrapper>(twitchApiWrapper ?? new Mock <ITwitchApiWrapper>().Object);
            services.AddSingleton <ITwitchBucketProvider>(bucketProvider ?? new Mock <ITwitchBucketProvider>().Object);
            services.AddSingleton <IKeyGenerator>(x => keyGenerator ?? new Mock <IKeyGenerator>().Object);
            services.AddTransient <IHubContext <ChatWebPageHub, IChatWebPageHub> >(x => hubContext ?? new Mock <IHubContext <ChatWebPageHub, IChatWebPageHub> >().Object);
            services.Configure <TwitchOptions>(configuration.GetSection("Twitch"));

            var provider = services.BuildServiceProvider();

            return(provider.GetRequiredService <IMediator>());
        }
コード例 #5
0
 public WorkerHost(
     IEventBus bus,
     IList <ITextToSpeechProcessor> textToSpeechProcessors,
     ITwitchClientWrapper clientWrapper,
     ITwitchApiWrapper apiWrapper,
     ILogger logger,
     IConfigurationManager configurationManager,
     IPresenceStore presenceStore,
     IChatCommandResolver chatCommandResolver,
     ISoundProcessor soundProcessor,
     IConfigurationPathProvider configurationPathProvider)
 {
     this.bus = bus;
     this.textToSpeechProcessors = textToSpeechProcessors;
     this.clientWrapper          = clientWrapper;
     this.apiWrapper             = apiWrapper;
     this.logger = logger.ForContext <WorkerHost>();
     this.configurationManager      = configurationManager;
     this.presenceStore             = presenceStore;
     this.chatCommandResolver       = chatCommandResolver;
     this.soundProcessor            = soundProcessor;
     this.configurationPathProvider = configurationPathProvider;
 }
コード例 #6
0
 public ShoutOutHandler(ITwitchApiWrapper apiWrapper, ITwitchClient client, ITwitchBucketProvider bucketProvider)
 {
     _api            = apiWrapper;
     _client         = client;
     _bucketProvider = bucketProvider;
 }
コード例 #7
0
 public DeleteBirthdayCommand(ITwitchApiWrapper twitchApiWrapper, IConfigurationManager configurationManager, IEventBus eventBus)
 {
     this.twitchApiWrapper     = twitchApiWrapper;
     this.configurationManager = configurationManager;
     this.eventBus             = eventBus;
 }
コード例 #8
0
 public TroutHandler(ITwitchClient twitchClient, ITwitchApiWrapper apiWrapper)
 {
     _twitchClient = twitchClient;
     _apiWrapper   = apiWrapper;
 }