lucadevelop/telegram-entities-decoder
A Laravel/PHP package that decodes Telegram Bot API message entities into readable formatted text, converting bold, italic, links, mentions, code, and other entities into HTML or Markdown-ready output for bots and chat applications.
Package context. The v1.4 notes describe entity-model and MarkdownV2 serialization work — expandable_blockquote and date_time entity types, plus two MarkdownV2 parsing/formatting fixes. This is a Telegram Bot API formatting layer, most likely a Laravel bridge (facade/service provider + message/entity builders) that translates rich-text/entity structures into MarkdownV2 and Markdown/HTML payloads for the Bot API. There is no prior assessment on file, so this evaluation is established from the release notes alone and should be treated as a baseline to be validated against the actual repository.
Architecture fit. Low architectural risk. Entity types and MarkdownV2 escaping are leaf-level concerns: they sit inside the message-composition layer and should not touch queueing, HTTP transport, webhook routing, or the service container wiring that a Laravel integration normally owns. The change is additive at the domain model boundary (two new entity types) and corrective at the serialization boundary. Packages of this shape fit a Laravel codebase cleanly via a service provider, config file, and optional facade, and are typically swappable behind a thin internal notifier/messenger abstraction — worth confirming that abstraction exists before committing.
Integration feasibility. Straightforward. Two independent workstreams: (1) accept two new inbound entity types without throwing on unknown discriminators, and (2) re-baseline MarkdownV2 golden-file output. The second is the only real work, because the separator change alters byte-level output for messages containing adjacent/ambiguous entities. Both are testable offline without hitting the Telegram API, which keeps cycle time short.
Technical risk.
\r to ** will silently change rendered messages wherever the old workaround was load-bearing. Messages that previously rendered correctly could now produce mismatched bold markers, and because ** is not itself MarkdownV2 bold syntax (bold is *…*), any escaping or entity-wrapping bug here surfaces as a Telegram 400 can't parse entities at send time, not at build time. Treat as a medium-likelihood, low-severity-but-high-visibility regression.expandable_blockquote. Requires nested blockquote serialization and correct handling when an expandable blockquote contains other entities. Interaction with the new separator is the highest-risk path and needs explicit coverage; older Bot API versions reject the nested form, so a version-gating decision is required.date_time. Entities carry unix_time and date_time_format fields. Confirm whether this type is inbound-only (parsed from received updates) or round-trips on send; if it is inbound-only, the sender must not attempt to synthesize it or it will emit invalid payloads.Key questions.
\r → ** change strictly a fix per Telegram docs, or does it alter output for previously working messages? Provide a before/after example.date_time supported on send, or parse-only?expandable_blockquote on a configurable Bot API version?Stack fit. Standard Laravel package profile: Composer install, auto-discovered service provider, publishable config, facade. No PHP extension or infrastructure dependency implied by these notes. Confirm supported PHP and Laravel version ranges before adoption — a package pinned to an older Laravel major is the most common blocker in this category.
Migration path. Low effort, gated on test coverage:
composer.json and capture the outgoing MarkdownV2 output for a representative message corpus before upgrading (golden files).No data migration, no schema change, no re-auth. This is a dependency bump plus a formatting re-baseline.
Compatibility. Two axes to clear:
expandable_blockquote requires a recent Bot API; older self-hosted Bot API servers or a pinned client version will reject it. Gate it on a config flag rather than emitting it unconditionally.Also confirm behavior when the Telegram API rejects a message: does the package throw a typed exception the app can catch, or bubble an opaque HTTP error? This matters more than the entity changes.
Sequencing. (1) Verify package identity, changelog, and SemVer intent. (2) Build the golden-file harness — this is the real deliverable and is reusable for every future bump. (3) Upgrade in a branch, classify diffs. (4) Add version gating for expandable_blockquote; confirm date_time send semantics. (5) Roll out to a low-traffic notification type first (e.g. internal alerts, not customer-facing), observe a week of send-failure rates. (6) Promote broadly, then remove the temporary shim if one was added.
Maintenance. Near zero steady-state cost — a leaf dependency with no runtime services, no cron, no storage. The recurring cost is the golden-file harness: someone must own re-baselining MarkdownV2 output on each Telegram Bot API release. Assign that to a named owner; unowned formatting fixtures rot quickly and the harness then produces false confidence.
Support. Failure signature is highly diagnosable: Telegram returns a descriptive 400 with the offending offset for parse errors, so on-call triage is "read the error, find the entity, fix the escaping." Document that path in the runbook. The support burden concentrates upstream — if the maintainer is slow on new Bot API entity types, the app must tolerate unknown entities rather than crash, which is a property to verify now, not after the next Bot API release.
Scaling. Entity construction and MarkdownV2 serialization are pure in-process string work: microseconds, no I/O, scales linearly with message volume and is dwarfed by the HTTP call itself. The real scaling constraint in any Telegram integration is rate limits and queue throughput, neither of which v1.4 touches. No capacity planning needed for this change.
Failure modes.
** separator produces a valid-but-wrong message rather than an error. Highest-impact mode, because it reaches users before anyone notices. Mitigate with golden files and a rendering check on a sample of real sends.400 can't parse entities; messages are lost unless the send is queued with retry. Confirm the app's notifier retries or dead-letters rather than dropping.expandable_blockquote against an older Bot API returns an error at send time; gate it.Ramp-up. Under a day for a developer familiar with Laravel packages: the entity model is small, the surface is a builder plus a serializer, and the release notes are self-explanatory. Budget the time on the golden-file harness rather than on learning the API — that is where the actual risk sits. No specialized Telegram knowledge is required beyond understanding that MarkdownV2 is strict about escaping and that entity offsets are UTF-16 code units, which is a classic off-by-one trap for anyone editing the serializer.
How can I help you explore Laravel packages today?