BotNetwork

Role checks for privileged commands

authorize by role id because names are renamable.

Guide1 min readUpdated

Why it matters

Authorize by role id because names are renamable.

Practical steps

  1. Compare against configured role ids
  2. Allow guild owner as break-glass only if intended
  3. Fail ephemeral when unauthorized
  4. Re-fetch member when cache may be stale
  5. Document required roles in admin help

Watch out for

  • Copy-pasting outdated snippets for discord role gates without re-reading current official docs.
  • Shipping discord role gates to production without a staging rehearsal and a documented rollback.

Related comparisons and tools