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

x/grammy/context.ts>Context#hasChatType

The Telegram Bot Framework.
Very Popular
Latest
method Context.prototype.hasChatType
import { Context } from "https://deno.land/x/grammy@v1.30.1/context.ts";

Returns true if this context object belongs to a chat with the given chat type, and false otherwise. This uses the same logic as bot.chatType.

Type Parameters

T extends Chat["type"]

Parameters

chatType: MaybeArray<T>

The chat type to match

Returns

this is ChatTypeContextCore<T>