Takeaway
Store platform ids as text
Why
Snowflake ids exceed JS/JSON number precision — store them as strings end-to-end.
Do this
- Use TEXT/STRING columns for Discord/Telegram ids.
- Parse with BigInt only when doing bit math.
- Add a CI lint for Number(id) on snowflakes.