BlueMarket
  • Home
  • Marketplace
  • Explore
  • Forums
  • Communities
  • Projects
  • Profile
  • Friends
  • Messages
  • Library
  • Wishlist
  • Wallet
  • My Store
Blue+Private communities & more

Demo data

RulesAffiliatesSupport

/
Sign inJoin
  • Home
  • Market
  • Explore
  • Forums
  • Library
Forums/JavaScript

How are you structuring slash-command handlers in discord.js v14?

VVesperJavaScriptNov 9, 2026 2,140 38

My bot is at ~60 commands and a single interactionCreate handler has become unmanageable. I'm considering a file-based router similar to Next.js.

How are you all organizing command registration, permissions and cooldowns?

#discord.js#architecture

Report thread

What's wrong?

Reports are confidential. Abuse of the report system may lead to account restrictions.

38 replies · showing 3

  1. V
    VOIDSTUDIOPro2d ago Accepted answer

    We use a folder per command with a definition.ts and handler.ts, then a build step that generates the registration payload. Permissions and cooldowns live in the definition so they're checked before the handler ever runs.

    The big win is that command registration becomes a diff: only changed commands get pushed to Discord.

    Report post

    What's wrong?

    Reports are confidential. Abuse of the report system may lead to account restrictions.

  2. AD
    atlas.devPro1d ago

    +1 to file-based. I'd add a middleware chain (auth → cooldown → validate options) so handlers stay tiny.

    Report post

    What's wrong?

    Reports are confidential. Abuse of the report system may lead to account restrictions.

  3. F
    FerroBlue+1h ago

    Same approach here. Keep cooldowns in Redis if you run multiple shards, otherwise they reset per process.

    Report post

    What's wrong?

    Reports are confidential. Abuse of the report system may lead to account restrictions.

Sign in to reply.

Related discussions

AD

Next.js 16 proxy.ts — anyone migrated auth refresh yet?

atlas.dev·8d ago#nextjs#supabase

44

replies

4.6K

views

3h ago

by Vesper

44
AD

Idempotent webhook processing with Postgres advisory locks

atlas.dev·12d ago#postgres#stripe

15

replies

2.2K

views

2d ago

by VOIDSTUDIO

15

Posting guidelines

Be specific, share code, credit others. Security discussion must stay defensive or educational — no live targets, credentials or malware. Full rules