Skip to content

Handle non existent commands during development - #214

Merged
jeremy-rifkin merged 2 commits into
TCCPP:mainfrom
xLuxy:features/command-improvement
Jul 20, 2026
Merged

Handle non existent commands during development#214
jeremy-rifkin merged 2 commits into
TCCPP:mainfrom
xLuxy:features/command-improvement

Conversation

@xLuxy

@xLuxy xLuxy commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Currently, when freestanding is set to true and you try to use a command which is not registered the bot will throw an exception. (I've used the modlogs command for testing)

This PR fixes that by adding a missing return statement.

As a small improvement to this, i've also added a response to whenever a command has not been registered which can help during development.

Context:

🛑 [2026.03.17 20:18:25.763] [error] TypeError: Cannot read properties of undefined (reading 'options')
    at CommandHandler.handle_slash_comand (file:///D:/dev/wheatley/build/src/command-handler.js:157:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async CommandHandler.on_interaction (file:///D:/dev/wheatley/build/src/command-handler.js:331:17)
Error
  TypeError: Cannot read properties of undefined (reading 'options')
      at CommandHandler.handle_slash_comand (file:///D:/dev/wheatley/build/src/command-handler.js:157:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
      at async CommandHandler.on_interaction (file:///D:/dev/wheatley/build/src/command-handler.js:331:17)
  Trace
      at M.error (file:///D:/dev/wheatley/build/src/utils/debugging-and-logging.js:61:17)
      at Wheatley.critical_error (file:///D:/dev/wheatley/build/src/wheatley.js:229:15)
      at CommandHandler.on_interaction (file:///D:/dev/wheatley/build/src/command-handler.js:405:31)
      at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

@xLuxy
xLuxy force-pushed the features/command-improvement branch from 28cb601 to 288d210 Compare March 17, 2026 19:21
@sonarqubecloud

Copy link
Copy Markdown

@xLuxy xLuxy changed the title Fix non existent command handling from crashing the bot Handle non existent commands during development Mar 17, 2026
@Rinzii

Rinzii commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Iirc #210 partially already handles this, but I'd say this should expand on what I did in that PR well so PR is still valid.

@suidvandiewereld

This comment was marked as low quality.

@Rinzii

Rinzii commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

PASS YOUR CI BUDDY

This CI failing is related to something else inside of the repo main already not related to this PR.

@suidvandiewereld

This comment was marked as low quality.

suidvandiewereld

This comment was marked as low quality.

@jeremy-rifkin

Copy link
Copy Markdown
Member

LGTM thanks @xLuxy

@jeremy-rifkin
jeremy-rifkin merged commit a652dce into TCCPP:main Jul 20, 2026
4 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants