Error getting when running unrelated subcommand?
I get this
TypeError: Cannot read properties of undefined (reading 'colour')
at Object.execute (/home/runner/Macron-Bot-Upload/commands/defcon.js:33:44)
at Client.<anonymous> (/home/runner/Macron-Bot-Upload/index.js:59:19)
at Client.emit (node:events:390:28)
at Client.emit (node:domain:475:12)
at InteractionCreateAction.handle (/home/runner/Macron-Bot-Upload/node_modules/discord.js/src/client/actions/InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (/home/runner/Macron-Bot-Upload/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/Macron-Bot-Upload/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/home/runner/Macron-Bot-Upload/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)
at WebSocketShard.onMessage (/home/runner/Macron-Bot-Upload/node_modules/discord.js/src/client/websocket/WebSocketShard.js:321:10)
When running my reset subcommand, despite the logs that create the error not being fired by the subcommand, and when I fire the related sub command theres no error?
What?
4 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
My code:
yeah
but i get the error
when running the /defcon reset
but not when I run /defcon set x
so it gives me the error when I run the unrelated subcommand
yeah
i dont see what the problem is
it works
It doesnt error when I run /defcon set but when I run /defcon reset it does
no, its not needed there
the level is an option, but it could also be the id from the json
yes
is nothing, so should I put it within the set cfommand?
OH
I seee now
the reset has no level
so its getting a non existant parameter thing
thank you
also now
const level = interaction.options.getInteger('level');
returns null? does sub command options work differently?When I run it, I think its because I didn't restart but now I did the command doesn't get responded to at all
Yes, I think the } for the first one was going over the resset command though
yeah was that
thanks again