I don't understand...
C:\Users\Torren\Desktop\JS-Bot-Apeture\index.js:27
if ('data' in command && 'execute' in command) {
^
ReferenceError: command is not defined
at Object.<anonymous> (C:\Users\Torren\Desktop\JS-Bot-Apeture\index.js:27:19)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
17 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.-
ReferenceError: "x" is not defined
: learn more
- TypeError: Cannot read properties of undefined/null (reading "x")
: learn moreSo, command isn't defined?
command is not defined indeed
I looked on 23...
I don't see where I went wrong within the guide...
show your code
Pastebin
Code.1 - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you declare your command variable inside an if loop, making it only available to any code inside it, not outside
I see. so.. I need to remove line 27?
no, put your code inside that if loop
i meant the for loop, my bad
Why is the guide like random?
the guide is correct
Perhaps I must've missed something :P
anyhow's thank you!
yw