Commit a652dce
Handle non existent commands during development (#214)
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)
```
Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>1 parent 01261cb commit a652dce
1 file changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
190 | 206 | | |
191 | 207 | | |
192 | 208 | | |
| |||
0 commit comments