TelegramBots / Telegram.Bot.Framework

Simple framework for building Telegram bots
MIT License
97 stars 43 forks source link

BotManager in webhook mode #13

Open tuscen opened 6 years ago

tuscen commented 6 years ago

There is a problem with IBotManager<TBot> instances lifetime in webhook mode. Each middleware in ASP.NET Core is instantiated once and is kept in memory as a part of middleware pipeline. So it is essentially a singleton. But IBotManager<TBot> has scoped lifetime. IBotManager<TBot> should be injected as a parameter of Invoke method here.