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
d.js toolkit
d.js toolkit12mo ago
• 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.
d.js docs
d.js docs12mo ago
- ReferenceError: "x" is not defined: learn more - TypeError: Cannot read properties of undefined/null (reading "x"): learn more
DarkVersatile
DarkVersatile12mo ago
So, command isn't defined?
treble/luna
treble/luna12mo ago
command is not defined indeed
DarkVersatile
DarkVersatile12mo ago
I looked on 23... I don't see where I went wrong within the guide...
treble/luna
treble/luna12mo ago
show your code
DarkVersatile
DarkVersatile12mo ago
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.
treble/luna
treble/luna12mo ago
you declare your command variable inside an if loop, making it only available to any code inside it, not outside
DarkVersatile
DarkVersatile12mo ago
I see. so.. I need to remove line 27?
treble/luna
treble/luna12mo ago
no, put your code inside that if loop i meant the for loop, my bad
DarkVersatile
DarkVersatile12mo ago
DarkVersatile
DarkVersatile12mo ago
DarkVersatile
DarkVersatile12mo ago
Why is the guide like random?
treble/luna
treble/luna12mo ago
the guide is correct
DarkVersatile
DarkVersatile12mo ago
Perhaps I must've missed something :P anyhow's thank you!
treble/luna
treble/luna12mo ago
yw