Download the PHP package lucadevelop/telegram-entities-decoder without Composer
On this page you can find all versions of the php package lucadevelop/telegram-entities-decoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucadevelop/telegram-entities-decoder
More information about lucadevelop/telegram-entities-decoder
Files in lucadevelop/telegram-entities-decoder
Package telegram-entities-decoder
Short Description Telegram entities decoder in PHP
License MIT
Informations about the package telegram-entities-decoder
telegram-entities-decoder
This class decode style entities from Telegram bot messages (bold, italic, etc.) in text with inline entities that duplicate (when possible) the exact style the message had originally when was sended to the bot. All this work is necessary because Telegram returns offset and length of the entities in UTF-16 code units that they've been hard to decode correctly in PHP
Consider to ⭐️ Star this project
Compatibility
PHP >= 7.0
Features
- Decode entities from text messages and attachments caption.
- Supports all Telegram parse modes (Markdown, HTML and MarkdownV2). HTML has more entropy but it's easily the best and it's recommended.
- Supports emoji in the text field
- Easy to use
NOTE: Markdown parse mode is deprecated and no longer up-to-date so it doesn't support all entities. Use MarkdownV2 or HTML.
Example usage
See demo folder for full example
Composer
Usage:
Credits
- Telegram docs: https://core.telegram.org/bots/api#formatting-options
- Inspired By: https://github.com/php-telegram-bot/core/issues/544#issuecomment-564950430
Contacts
All versions of telegram-entities-decoder with dependencies
ext-mbstring Version *