public async Task RunAsync(
            GetUpdatesRequest requestParams     = default,
            CancellationToken cancellationToken = default
            )
        {
            var bot = (TBot)_rootProvider.GetService(typeof(TBot));

            await bot.Client.DeleteWebhookAsync(cancellationToken : cancellationToken)
            .ConfigureAwait(false);

            requestParams ??= new GetUpdatesRequest
            {
                Offset         = 0,
                Timeout        = 500,
                AllowedUpdates = Array.Empty <UpdateType>(),
            };

            while (!cancellationToken.IsCancellationRequested)
            {
                try
                {
                    Update[] updates = await bot.Client.MakeRequestAsync(
                        requestParams,
                        cancellationToken
                        ).ConfigureAwait(false);

                    foreach (var update in updates)
                    {
                        using var scopeProvider = _rootProvider.CreateScope();
                        var context = new UpdateContext(bot, update, scopeProvider);
                        // ToDo deep clone bot instance for each update
                        await _updateDelegate(context, cancellationToken)
                        .ConfigureAwait(false);
                    }

                    if (updates.Length > 0)
                    {
                        requestParams.Offset = updates[updates.Length - 1].Id + 1;
                    }
                }
                catch (HttpRequestException e)
                {
                    Console.WriteLine($"[{DateTime.Now}] {e.Message}");
                }
                catch (Exception e)
                {
                    Console.WriteLine($"[{DateTime.Now}] {e}");
                }
            }

            cancellationToken.ThrowIfCancellationRequested();
        }
        public async Task RunAsync(
            GetUpdatesRequest requestParams     = default,
            CancellationToken cancellationToken = default
            )
        {
            var bot = (TBot)_rootProvider.GetService(typeof(TBot));

            await bot.Client.DeleteWebhookAsync(cancellationToken)
            .ConfigureAwait(false);

            requestParams = requestParams ?? new GetUpdatesRequest
            {
                Offset         = 0,
                Timeout        = 500,
                AllowedUpdates = new UpdateType[0],
            };

            while (!cancellationToken.IsCancellationRequested)
            {
                Update[] updates = await bot.Client.MakeRequestAsync(
                    requestParams,
                    cancellationToken
                    ).ConfigureAwait(false);

                foreach (var update in updates)
                {
                    using (var scopeProvider = _rootProvider.CreateScope())
                    {
                        var context = new UpdateContext(bot, update, scopeProvider);

                        // update telegram bot user state.
                        var stateService = scopeProvider.GetService <IStateCacheService>();
                        if (stateService != null)
                        {
                            stateService.CacheContext(context);
                        }

                        // ToDo deep clone bot instance for each update
                        await _updateDelegate(context)
                        .ConfigureAwait(false);
                    }
                }

                if (updates.Length > 0)
                {
                    requestParams.Offset = updates[updates.Length - 1].Id + 1;
                }
            }

            cancellationToken.ThrowIfCancellationRequested();
        }