route(router, routeHandlers, fallback = pass) {
        return this.lazy(async (ctx) => {
            var _a;
            const route = await router(ctx);
            return (_a = (route === undefined || !routeHandlers[route]
                ? fallback
                : routeHandlers[route])) !== null && _a !== void 0 ? _a : [];
        });
    }
/**
     * > This is an advanced method of grammY.
     *
     * _Not to be confused with the `router` plugin._
     *
     * This method is an alternative to the `router` plugin. It allows you to
     * branch between different middleware per context object. You can pass two
     * things to it:
     * 1. A routing function
     * 2. Different middleware identified by key
     *
     * The routing function decides based on the context object which middleware
     * to run. Each middleware is identified by a key, so the routing function
     * simply returns the key of that middleware.
     * ```ts
     * // Define different route handlers
     * const routeHandlers = {
     *   evenUpdates: (ctx: Context) => { ... }
     *   oddUpdates: (ctx: Context) => { ... }
     * }
     * // Decide for a context object which one to pick
     * const router = (ctx: Context) => ctx.update.update_id % 2 === 0
     *   ? 'evenUpdates'
     *   : 'oddUpdates'
     * // Route it!
     * bot.route(router, routeHandlers)
     * ```
     *
     * Optionally, you can pass a third option that is used as fallback
     * middleware if your route function returns `undefined`, or if the key
     * returned by your router has no middleware associated with it.
     *
     * This method may need less setup than first instanciating a `Router`, but
     * for more complex setups, having a `Router` may be more readable.
     *
     * @param router The routing function to use
     * @param routeHandlers Handlers for every route
     * @param fallback Optional fallback middleware if no route matches
     */
> This is an advanced method of grammY.

This method is an alternative to the `router` plugin. It allows you to
branch between different middleware per context object. You can pass two
things to it:
1. A routing function
2. Different middleware identified by key

The routing function decides based on the context object which middleware
to run. Each middleware is identified by a key, so the routing function
simply returns the key of that middleware.
```ts
Define different route handlers
const routeHandlers = {
evenUpdates: (ctx: Context) => { ... }
oddUpdates: (ctx: Context) => { ...

Optionally, you can pass a third option that is used as fallback
middleware if your route function returns `undefined`, or if the key
returned by your router has no middleware associated with it.

This method may need less setup than first instanciating a `Router`, but
for more complex setups, having a `Router` may be more readable.

@param router The routing function to use
@param routeHandlers Handlers for every route
@param fallback Optional fallback middleware if no route matches
> This is an advanced method of grammY . This method is an alternative to the ` router ` plugin . It allows you to branch between different middleware per context object . You can pass two things to it : 1 . A routing function 2 . Different middleware identified by key The routing function decides based on the context object which middleware to run . Each middleware is identified by a key so the routing function simply returns the key of that middleware . ` ` ` ts Define different route handlers const routeHandlers = { evenUpdates : ( ctx : Context ) = > { ... } oddUpdates : ( ctx : Context ) = > { ... Optionally you can pass a third option that is used as fallback middleware if your route function returns ` undefined ` or if the key returned by your router has no middleware associated with it . This method may need less setup than first instanciating a ` Router ` but for more complex setups having a ` Router ` may be more readable . @param router The routing function to use @param routeHandlers Handlers for every route @param fallback Optional fallback middleware if no route matches
route(router, routeHandlers, fallback = pass) {
        return this.lazy(async (ctx) => {
            var _a;
            const route = await router(ctx);
            return (_a = (route === undefined || !routeHandlers[route]
                ? fallback
                : routeHandlers[route])) !== null && _a !== void 0 ? _a : [];
        });
    }
route ( router , routeHandlers , fallback = pass ) { return this . lazy ( async ( ctx ) => { var _a ; const route = await router ( ctx ) ; return ( _a = ( route === undefined || ! routeHandlers [ route ] ? fallback : routeHandlers [ route ] ) ) !== null && _a !== void 0 ? _a : [ ] ; } ) ; }
> This is an advanced method of grammY.
> This is an advanced method of grammY .