Skip to main content

Intro

Provides functionality to easily build formatted messages.

Installation

PNPm

pnpm add @tlgr/fmt

yarn

yarn add @tlgr/fmt

npm

npm i @tlgr/fmt

Example

formatter.example.ts
import { fmt, bold, italic, strikethrough } from "@tlgr/fmt/string";
import { Telegraf } from "telegraf";

const bot = new Telegraf("<API TOKEN>");

bot.start((ctx) => {
ctx.reply(
...fmt(
`this example shows ${bold("bold")}, ${italic(
"italic"
)} and ${strikethrough("strikethrough")} texts`
)
);
});

bot.launch();

Demo

fmt demo