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.
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. ButIBotManager<TBot>
has scoped lifetime.IBotManager<TBot>
should be injected as a parameter ofInvoke
method here.