Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy/mod.ts>NextFunction

The Telegram Bot Framework.
Very Popular
Latest
type alias NextFunction
import { type NextFunction } from "https://deno.land/x/grammy@v1.30.1/mod.ts";

A function of this type is passed as the second parameter to all middleware. Invoke it to call the downstream middleware and pass on the control flow.

In other words, if your middleware is done handling the context object, and other middleware should take over, this function should be called and awaited.

Once the Promise returned by this function resolves, the downstream middleware is done executing, hence returning the control.

definition: () => Promise<void>