1.1.0 • Published 11 days ago

@telegram.ts/formatters v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
11 days ago

@telegram.ts/formatters

NPM Version Bot API NPM Downloads License

@telegram.ts/formatters is a TypeScript library that provides functions for formatting messages according to the Telegram API's formatting rules. It offers a set of functions for applying various text formatting styles.

Features

  • Text Formatting: Apply bold, italic, underline, strikethrough, and spoiler formatting to text.
  • Inline URLs and Mentions: Create clickable inline URLs and user mentions within messages.
  • Emoji Support: Embed emojis into messages for expressive communication.
  • Code Blocks: Format text as inline or pre-formatted code blocks with syntax highlighting support.

Installation

You can install @telegram.ts/formatters via npm or yarn:

npm install @telegram.ts/formatters
# or
yarn add @telegram.ts/formatters

Usage

import {
    html: {
    bold,
    italic,
    underline,
    strikethrough,
    spoiler,
    inlineURL,
    inlineMention,
    inlineEmoji,
    inlineCode,
    codeBlock,
    }
} from '@telegram.ts/formatters';

// Apply text formatting
const formattedText = bold('bold text') + '\n' +
    italic('italic text') + '\n' +
    underline('underline') + '\n' +
    strikethrough('strikethrough') + '\n' +
    spoiler('spoiler');

console.log(formattedText);

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please create a GitHub issue or submit a pull request. Additionally, feel free to reach out to me on Telegram via my username @SempaiJS or on Discord using my username sempaika_chess.

1.1.0

11 days ago

1.0.0

2 months ago

0.4.1

11 months ago

0.3.5

12 months ago

0.3.0

12 months ago

0.2.9

12 months ago