Ejemplo n.º 1
0
        // 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();
        }
Ejemplo n.º 2
0
 public HooksController(ILogger <HooksController> logger, IMessagesQueue messageQueue)
 {
     _logger       = logger;
     _messageQueue = messageQueue;
 }