Module

x/grammy/mod.ts>ChatTypeContext

The Telegram Bot Framework.
Very Popular
Go to Latest
type alias ChatTypeContext
import { type ChatTypeContext } from "https://dotland.deno.dev/x/grammy@v1.10.0/mod.ts";

Type of the context object that is available inside the handlers for bot.chatType.

This helper type can be used to narrow down context objects the same way how bot.chatType does it. This allows you to annotate context objects in middleware that is not directly passed to bot.chatType, hence not inferring the correct type automatically. That way, handlers can be defined in separate files and still have the correct types.

Type Parameters

C extends Context
T extends Chat["type"]
definition:
& C
& Record<"update", ChatTypeUpdate<T>>
& ChatType<T>
& ChatTypeRecord<"msg", T>
& AliasProps<ChatTypeUpdate<T>>