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

x/grammy_parse_mode/mod.ts>FormattedString

Safely format messages and keep their source code maintainable.
Latest
class FormattedString
implements Stringable
Re-export
import { FormattedString } from "https://deno.land/x/grammy_parse_mode@1.10.0/mod.ts";

Represents the formatted string after the parsing.

Constructors

new
FormattedString(text: string, entities: MessageEntity[])

Creates a new FormattedString. Useful for constructing a FormattedString from user's formatted message

// Constructing a new `FormattedString` from user's message
const userMsg = new FormattedString(ctx.message.text, ctx.entities());

Properties

entities: MessageEntity[]

Format entities for this FormattedString

text: string

Plain text value for this FormattedString

Methods

Returns the string representation of this object