async stop() {
        var _a;
        if (this.pollingRunning) {
            debug("Stopping bot, saving update offset");
            this.pollingRunning = false;
            (_a = this.pollingAbortController) === null || _a === void 0 ? void 0 : _a.abort();
            const offset = this.lastTriedUpdateId + 1;
            await this.api.getUpdates({ offset, limit: 1 });
            this.pollingAbortController = undefined;
        }
        else {
            debug("Bot is not running!");
        }
    }
/**
     * Stops the bot from long polling.
     *
     * All middleware that is currently being executed may complete, but no
     * further `getUpdates` calls will be performed. The current `getUpdates`
     * request will be cancelled.
     *
     * In addition, this method will _confirm_ the last received update to the
     * Telegram servers by calling `getUpdates` one last time with the latest
     * offset value. If any updates are received in this call, they are
     * discarded and will be fetched again when the bot starts up the next time.
     * Confer the official documentation on confirming updates if you want to
     * know more: https://core.telegram.org/bots/api#getupdates
     *
     * > Note that this method will not wait for the middleware stack to finish.
     * > If you need to run code after all middleware is done, consider waiting
     * > for the promise returned by `bot.start()` to resolve.
     */
Stops the bot from long polling.
All middleware that is currently being executed may complete, but no
further `getUpdates` calls will be performed. The current `getUpdates`
request will be cancelled.

In addition, this method will _confirm_ the last received update to the
Telegram servers by calling `getUpdates` one last time with the latest
offset value. If any updates are received in this call, they are
discarded and will be fetched again when the bot starts up the next time.

> Note that this method will not wait for the middleware stack to finish.
> If you need to run code after all middleware is done, consider waiting
> for the promise returned by `bot.start()` to resolve.
Stops the bot from long polling . All middleware that is currently being executed may complete but no further ` getUpdates ` calls will be performed . The current ` getUpdates ` request will be cancelled . In addition this method will _confirm_ the last received update to the Telegram servers by calling ` getUpdates ` one last time with the latest offset value . If any updates are received in this call they are discarded and will be fetched again when the bot starts up the next time . > Note that this method will not wait for the middleware stack to finish . > If you need to run code after all middleware is done consider waiting > for the promise returned by ` bot . start () ` to resolve .
async stop() {
        var _a;
        if (this.pollingRunning) {
            debug("Stopping bot, saving update offset");
            this.pollingRunning = false;
            (_a = this.pollingAbortController) === null || _a === void 0 ? void 0 : _a.abort();
            const offset = this.lastTriedUpdateId + 1;
            await this.api.getUpdates({ offset, limit: 1 });
            this.pollingAbortController = undefined;
        }
        else {
            debug("Bot is not running!");
        }
    }
async stop ( ) { var _a ; if ( this . pollingRunning ) { debug ( "Stopping bot, saving update offset" ) ; this . pollingRunning = false ; ( _a = this . pollingAbortController ) === null || _a === void 0 ? void 0 : _a . abort ( ) ; const offset = this . lastTriedUpdateId + 1 ; await this . api . getUpdates ( { offset , limit : 1 } ) ; this . pollingAbortController = undefined ; } else { debug ( "Bot is not running!" ) ; } }
Stops the bot from long polling.
Stops the bot from long polling .