public IrcBotService(MessageQueueService queueService, IOptions <IrcBotConfiguration> options, BotRulePipeline pipeline) { this.queueService = queueService; this.pipeline = pipeline; config = options.Value; queueService.MessageAdded += QueueService_MessageAdded; InitializeClient(); }
private static void ConfigureIrcBot(IServiceCollection services, Action <BotRulePipeline> configurePipeline) { services.AddSingleton <MessageQueueService>(); var pipeline = new BotRulePipeline(services); configurePipeline?.Invoke(pipeline); services.AddHostedService(p => new IrcBotService( p.GetRequiredService <MessageQueueService>(), p.GetRequiredService <IOptions <IrcBotConfiguration> >(), pipeline )); }