Skip to main content


The Telegram Bot Framework.
Very Popular
Go to Latest
type alias ChatTypeMiddleware
import { type ChatTypeMiddleware } from "";

Type of the middleware that can be passed to bot.chatType.

This helper type can be used to annotate middleware functions that are defined in one place, so that they have the correct type when passed to bot.chatType in a different place. For instance, this allows for more modular code where handlers are defined in separate files.

Type Parameters

C extends Context
T extends Chat["type"]
definition: Middleware<ChatTypeContext<C, T>>