lazy(middlewareFactory) {
        return this.use(async (ctx, next) => {
            const middleware = await middlewareFactory(ctx);
            const arr = toArray(middleware);
            await flatten(new Composer(...arr))(ctx, next);
        });
    }
/**
     * > This is an advanced method of grammY.
     *
     * Executes some middleware that can be generated on the fly for each
     * context. Pass a factory function that creates some middleware (or a
     * middleware array even). The factory function will be called once per
     * context, and its result will be executed with the context object.
     * ```ts
     * // The middleware returned by `createMyMiddleware` will be used only once
     * bot.lazy(ctx => createMyMiddleware(ctx))
     * ```
     *
     * You may generate this middleware in an `async` fashion.
     *
     * You can decide to return an empty array (`[]`) if you don't want to run
     * any middleware for a given context object. This is equivalent to
     * returning an empty instance of `Composer`.
     *
     * @param middlewareFactory The factory function creating the middleware
     */
> This is an advanced method of grammY.
Executes some middleware that can be generated on the fly for each
context. Pass a factory function that creates some middleware (or a
middleware array even). The factory function will be called once per
context, and its result will be executed with the context object.

You may generate this middleware in an `async` fashion.

You can decide to return an empty array (`[]`) if you don't want to run
any middleware for a given context object. This is equivalent to
returning an empty instance of `Composer`.

@param middlewareFactory The factory function creating the middleware
> This is an advanced method of grammY . Executes some middleware that can be generated on the fly for each context . Pass a factory function that creates some middleware ( or a middleware array even ) . The factory function will be called once per context and its result will be executed with the context object . You may generate this middleware in an ` async ` fashion . You can decide to return an empty array ( ` [] ` ) if you don ' t want to run any middleware for a given context object . This is equivalent to returning an empty instance of ` Composer ` . @param middlewareFactory The factory function creating the middleware
lazy(middlewareFactory) {
        return this.use(async (ctx, next) => {
            const middleware = await middlewareFactory(ctx);
            const arr = toArray(middleware);
            await flatten(new Composer(...arr))(ctx, next);
        });
    }
lazy ( middlewareFactory ) { return this . use ( async ( ctx , next ) => { const middleware = await middlewareFactory ( ctx ) ; const arr = toArray ( middleware ) ; await flatten ( new Composer ( ... arr ) ) ( ctx , next ) ; } ) ; }
> This is an advanced method of grammY.
> This is an advanced method of grammY .