@rundik/telegram-text-entities-filler

0.2.2 • Public • Published

telegram-text-entities-filler

last commit version downloads license

Simple library that helps fills text with entities markup. Fork of https://www.npmjs.com/package/telegram-text-entities-filler

Installation

$ npm install @rundik/telegram-text-entities-filler

or using yarn:

$ yarn add @rundik/telegram-text-entities-filler

Example

This bot will respond with the same message, keeping the text markup

const Telegraf = require('telegraf');
const { fillMarkdownEntitiesMarkup } = require('@rundik/telegram-text-entities-filler');

const bot = new Telegraf(process.env.BOT_TOKEN);

bot.on('text', (ctx) =>
  ctx.reply(
    fillMarkdownEntitiesMarkup(ctx.message.text, ctx.message.entities),
    { parse_mode: "MarkdownV2" }
  )
);

bot.launch();

Readme

Keywords

Package Sidebar

Install

npm i @rundik/telegram-text-entities-filler

Weekly Downloads

8

Version

0.2.2

License

MIT

Unpacked Size

11.7 kB

Total Files

7

Last publish

Collaborators

  • rundik