feat: improve command handling
LU
6mo ago+43+43+01234567890123456789-17-17-01234567890123456789
Summary
Improves command handling with early validation and better error messages, and adds dev environment awareness for command loading.
Changes
- config.ts: add
isProductiongetter based onNODE_ENV - manager.ts: use
isBun || isDevto load commands fromsrc/in dev environment; addexists()method for early command validation - messageCreate.ts: use
exists()for early return before building context; distinguish between unknown command and failed execution error messages
Summary by cubic
Improves command handling with early validation and clearer errors, and loads commands from src/ in dev or Bun for faster local development. Adds config.isProduction based on NODE_ENV.
-
New Features
- Added
config.isProductiongetter (NODE_ENV === 'production'). - Command manager loads from
src/in Bun or non‑production; usesdist/in production Node. - Added
exists()for early command validation and short-circuiting. - Clearer replies: unknown command vs execution failure.
- Added
-
Bug Fixes
- Safely parse
content-lengthwithNumber(...)in remote upload. - Explicit Express typings for
appandRouterto resolve TS errors.
- Safely parse