// This method gets called by the runtime. Use this method to configure the HTTP request pipeline public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ITelegramBot bot, IMessagesQueue messagesQueue) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); loggerFactory.AddNLog(); app.UseMvc(); app.AddNLogWeb(); env.ConfigureNLog("nlog.config"); var accessToken = Configuration.GetSection("TelegramAccessToken")?.Value; var botname = Configuration.GetSection("TelegramBotName")?.Value; bot.Connect(accessToken, botname); bot.Start(); messagesQueue.Start(); }
public HooksController(ILogger <HooksController> logger, IMessagesQueue messageQueue) { _logger = logger; _messageQueue = messageQueue; }