0.2.2 • Published 3 years ago

@rundik/telegram-text-entities-filler v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

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();