fix: truncate long activity fields to prevent Discord rejection #18

Merged
deluan merged 3 commits from fix/truncate-long-fields into main 2026-03-04 10:48:56 -07:00

3 Commits

Author SHA1 Message Date
deluan bb7d6aaa5e test: use JSON unmarshalling for truncation test assertions
Replace fragile strings.Contains checks with proper JSON unmarshalling
to validate truncated fields by their exact values and verify URL fields
are correctly omitted.
2026-03-04 12:44:24 -05:00
deluan 2f846f2a87 fix: truncate long activity fields before sending to Discord
Apply truncateText to Name, Details, State, and LargeText fields.
Apply truncateURL to DetailsURL, StateURL, LargeURL, and SmallURL fields.
This prevents Discord from silently rejecting the entire presence update.
Fixes #16
2026-03-04 12:23:12 -05:00
deluan c5af3c1d63 feat: add truncateText and truncateURL helpers for Discord field limits
Discord silently rejects presence updates when text fields exceed 128
characters or URL fields exceed 256 characters. Fixes #16
2026-03-04 12:23:12 -05:00