0.2.0 • Published 5 years ago

telegram-text-entities-filler v0.2.0

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

Introduction

Simple library that helps fills text with entities markup

Installation

$ npm install telegram-text-entities-filler

or using yarn:

$ yarn add telegram-text-entities-filler

Example

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

const Telegraf = require('telegraf');
const { fillMarkdownEntitiesMarkup } = require('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();
0.2.0

5 years ago

0.1.0

5 years ago