Why it matters
Entity offsets use UTF-16 length; naive string indexes break on emoji.
Practical steps
- Use correct UTF-16 offset math or a maintained library
- Prefer entity metadata over regex on raw text
- Escape when echoing user content
- Disable link previews for untrusted URLs
- Test fixtures with emoji-heavy messages
Watch out for
- Copy-pasting outdated snippets for telegram message entities without re-reading current official docs.
- Shipping telegram message entities to production without a staging rehearsal and a documented rollback.