🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

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

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
8.8K
35.15%
Maintainers
1
Weekly downloads
 
Created
Source

telegram-escape

Codacy Badge

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*"

Functions

HTML`template_${string}`String
md`template_${string}`String
mdv1`template_${string}`String
escapeHTML(text)String
escapeMarkdown(text)String
escapeMarkdownV1(text)String

HTML`template_${string}`⇒ String

Kind: global function

md`template_${string}`⇒ String

Kind: global function

mdv1`template_${string}`⇒ String

Kind: global function

escapeHTML(text) ⇒ String

Kind: global function

ParamType
textString

escapeMarkdown(text) ⇒ String

Kind: global function

ParamType
textString

escapeMarkdownV1(text) ⇒ String

Kind: global function

ParamType
textString

Keywords

util

FAQs

Package last updated on 21 Aug 2022

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