Skip to content

feat: improve command handling#159

Open
lucaaszsx wants to merge 7 commits into
ysdragon:mainfrom
lucaaszsx:feat/improve-command-handling
Open

feat: improve command handling#159
lucaaszsx wants to merge 7 commits into
ysdragon:mainfrom
lucaaszsx:feat/improve-command-handling

Conversation

@lucaaszsx

@lucaaszsx lucaaszsx commented May 22, 2026

Copy link
Copy Markdown

Summary

Improves command handling with early validation and better error messages, and adds dev environment awareness for command loading.

Changes

  • config.ts: add isProduction getter based on NODE_ENV
  • manager.ts: use isBun || isDev to load commands from src/ in dev environment; add exists() 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.isProduction getter (NODE_ENV === 'production').
    • Command manager loads from src/ in Bun or non‑production; uses dist/ in production Node.
    • Added exists() for early command validation and short-circuiting.
    • Clearer replies: unknown command vs execution failure.
  • Bug Fixes

    • Safely parse content-length with Number(...) in remote upload.
    • Explicit Express typings for app and Router to resolve TS errors.

Written for commit acd1523. Summary will update on new commits. Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/config.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant