Skip to main content

Render

Formatter function which implements node.js util.inspect function.

Returns raw texts with telegram entities modifiers

fmt(input, [...args])​

added in 1.3.0
  • input - <string>. Input string, accepts TemplateStringArray instead of string.
  • args - <array> Formatter arguments. See util.inspect about inspect arguments.

returns​

Array of raw text without text modifiers and array of modifiers.

Example​

const formatteed = fmt(`some ${bold("bold")} text`);
formatted[0]; // some bold text
formatted[1]; // { entities: [
// { lenght: 4, offset: 5, type: 'bold' }
// ]}