BotNetwork

Slash command autocomplete

autocomplete handlers have a short deadline and must stay side-effect free.

Guide1 min readUpdated

Why it matters

Autocomplete handlers have a short deadline and must stay side-effect free.

Practical steps

  1. Keep handlers pure and fast
  2. Filter choices server-side by user input
  3. Respect Discord's max choices count
  4. Cache reference data used for options
  5. 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.

Related comparisons and tools