Lightweight Javascript utility zero-dependecy library for Telegram Bots developers for escaping user input with formatting options
npm install telegram-escape
Lightweight Javascript utility zero-dependecy library for Telegram Bots developers for escaping user input with formatting options
Installation
``bash`
npm i telegram-escape
Usage examples
`js
const { HTML } = require("telegram-escape");
const firstName = "
await bot.sendMessage(chatId, HTML${firstName}, {
parse_mode: "HTML",
}); // bold "
await bot.sendMessage(chatId, HTML${"2 < 3"}, {`
parse_mode: "HTML",
}); // bold "2 < 3"
`js
const { md } = require("telegram-escape");
const firstName = "My Cool Name";
await bot.sendMessage(chatId, md_${firstName}_, {`
parse_mode: "MarkdownV2",
}); // italic "My Cool Name"
⇒ String ⇒ String ⇒ StringStringStringString⇒ String⇒ StringStringStringKind: global function
| Param | Type |
| ----- | ------------------- |
| text | String |
StringKind: global function
| Param | Type |
| ----- | ------------------- |
| text | String |
StringKind: global function
| Param | Type |
| ----- | ------------------- |
| text | String |