Can't run the guide lightly modified bot

[WARNING] The command at /home/dainis/bot/commands/utility/info.js is missing a required "data" or "execute" property.
Ready! Logged in as xxxxxxxxxx
[WARNING] The command at /home/dainis/bot/commands/utility/info.js is missing a required "data" or "execute" property.
Ready! Logged in as xxxxxxxxxx
I have no idea what am I supposed to do.
48 Replies
d.js toolkit
d.js toolkit4mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Retro
Retro4mo ago
you forgot to export data
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
lmao jinx
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
weird. i can see myself typing on the members list
dainis
dainisOP4mo ago
I'm pretty sure my execute function is in an another file
dainis
dainisOP4mo ago
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
what- if you are not exporting it from your command file, itll return undefined
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
¯\_(ツ)_/¯
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
as far as i understand the file i gave you is the command and the other files i made are subcommands
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
info and user that is
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
i think you should learn a bit more about discord.js and nodejs itself ...
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
I did use nodejs a bit in the past But I never had to do anything this advanced
Retro
Retro4mo ago
yeah then learn a bit more and read and understand the guide fully tbh
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo ago
i got used to esm that i find this a bit uneasy for me 😭
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
How do I even define it when the execute is in another file?
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
Do I just module.exports = { execute }?
Retro
Retro4mo ago
You need to export both execute and data. Execute should be a function
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
I just did whatever it told me to do in the guide if I recall correctly
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
I'm pretty sure I cloned the example directory Don't get me wrong, I've read it
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
despite it being messy is it just not possible to cram everything that the bot needs into a single file like you can do with discord.py
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
like commands and everything everything in a single file
Retro
Retro4mo ago
It is
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna4mo ago
just know its nearly impossible to debug then, theres a reason the guide uses handlers
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna4mo ago
are you gonna scroll through multiple hunderds of lines of code to find an issue? i wont
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
My discord py bot has like 500 lines of code and I had no issues whatsoever
treble/luna
treble/luna4mo ago
anyhow, the guide is really clear and should easily be understanded if you have a basic knowledge about js
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
dainis
dainisOP4mo ago
I hope discordjs had similair functionality as I dislike pay and I know js better
treble/luna
treble/luna4mo ago
djs has no such functionality. js does djs is a js library
Retro
Retro4mo ago
You can code however you want if you know javascript well Single file multi file, it doesn't really matter
Want results from more Discord servers?
Add your server