Why it matters
Autocomplete handlers have a short deadline and must stay side-effect free.
Practical steps
- Keep handlers pure and fast
- Filter choices server-side by user input
- Respect Discord's max choices count
- Cache reference data used for options
- Never mutate durable state in autocomplete
Watch out for
- Copy-pasting outdated snippets for discord autocomplete without re-reading current official docs.
- Shipping discord autocomplete to production without a staging rehearsal and a documented rollback.