Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

telegram-escape

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram-escape

Lightweight Javascript utility zero-dependecy library for Telegram Bots developers for escaping user input with formatting options

Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
10K
-28.76%
Maintainers
1
Weekly downloads
 
Created
Source

telegram-escape

Lightweight Javascript utility zero-dependecy library for Telegram Bots developers for escaping user input with formatting options

Installation

npm i telegram-escape

Usage examples

const { HTML } = require("telegram-escape");

const firstName = "<My Cool Name>";

await bot.sendMessage(chatId, HTML`<b>${firstName}</b>`, {
  parse_mode: "HTML",
}); // bold "<My Cool Name>"

await bot.sendMessage(chatId, HTML`<b>${"2 < 3"}</b>`, {
  parse_mode: "HTML",
}); // bold "2 < 3"
const { md } = require("telegram-escape");

const firstName = "*My Cool Name*";

await bot.sendMessage(chatId, md`_${firstName}_`, {
  parse_mode: "MarkdownV2",
}); // italic "*My Cool Name*"

Keywords

util

FAQs

Package last updated on 20 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts