Module

x/grammy/context.ts>Context#hasText

The Telegram Bot Framework.
Very Popular
Go to Latest
method Context.prototype.hasText
import { Context } from "https://dotland.deno.dev/x/grammy@v1.20.0/context.ts";

Returns true if this context object contains the given text, or if it contains text that matches the given regular expression. It returns false otherwise. This uses the same logic as bot.hears.

Parameters

trigger: MaybeArray<string | RegExp>

The string or regex to match

Returns

this is HearsContextCore