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

x/telegram_format/types.ts>Formatter

Format Telegram message texts with Markdown or HTML
Latest
interface Formatter
import { type Formatter } from "https://deno.land/x/telegram_format@v3.1.0/types.ts";

All exported formatters satisfy this interface

Properties

parse_mode: "HTML" | "Markdown" | "MarkdownV2"

parse_mode which can be used on sendMessage

blockquote: (text: string) => string

Format the input text as blockquote

bold: (text: string) => string

Format the input text bold

escape: (text: string) => string

Escape the input text to be displayed as it is

italic: (text: string) => string

Format the input text italic

monospace: (text: string) => string

Format the input text as monospace

monospaceBlock: (text: string, programmingLanguage?: string) => string

Format the input text as a monospace block optionally with a programming language

spoiler: (text: string) => string

Format the input text as spoiler

strikethrough: (text: string) => string

Strikethrough the input text

tgEmoji: (fallback: string, emojiId: string) => string

Create a custom Telegram Emoji

underline: (text: string) => string

Underline the input text

url: (label: string, url: string) => string

Create an url with a label text

userMention: (label: string, userId: number) => string

Create a user mention with a label text