import { Context } from "https://dotland.deno.dev/x/grammy@v1.13.0/mod.ts";
Get entities and their text. Extracts the text from ctx.msg.text
or ctx.msg.caption
.
Returns an empty array if one of ctx.msg
, ctx.msg.text
or ctx.msg.entities
is undefined.
You can filter specific entity types by passing the types
parameter. Example:
ctx.entities() // Returns all entity types
ctx.entities('url') // Returns only url entities
ctx.enttities(['url', 'email']) // Returns url and email entities
Parameters
types: MaybeArray<T>