I thought it's a default thing?

Why is it an error, I don't understand
No description
No description
65 Replies
d.js toolkit
d.js toolkit3d 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!
treble/luna
treble/luna3d ago
you dont have such a folder make sure your pathing is correct
electric
electric3d ago
fixed it
electric
electric3d ago
how about this
No description
electric
electric3d ago
tryna made a slash command but all my files don't have application id
treble/luna
treble/luna3d ago
you provided undefined where an application and/or guild id is needed
electric
electric3d ago
I have guild ID but it somehow doesn't work
treble/luna
treble/luna3d ago
you also need the client id
electric
electric3d ago
have it
treble/luna
treble/luna3d ago
then pass it in
electric
electric3d ago
I did
treble/luna
treble/luna3d ago
show how
electric
electric3d ago
put in config.json and .env
treble/luna
treble/luna3d ago
why do you have both you pick one not both
electric
electric3d ago
the guide told me to use config.json but I had .env so i created both eventually
treble/luna
treble/luna3d ago
then use .env the guide shows example on both it does not mean use both
electric
electric3d ago
does it work if i do this
No description
treble/luna
treble/luna3d ago
..no the guide shows how to work with dotenv
electric
electric3d ago
it doesn't when it comes to registration
electric
electric3d ago
yea i know im not on that page
electric
electric3d ago
No description
treble/luna
treble/luna3d ago
then edit that to use dotenv its a guide its meant to guide you, not 'copy paste and go'
electric
electric3d ago
the issue is my friend help me coded the bot a bit and he stopped helping me and idk what should i do now start from the first or continue since the fundaments are here
treble/luna
treble/luna3d ago
do you know js
electric
electric3d ago
know the basics
treble/luna
treble/luna3d ago
then it shouldnt be too hard to edit that to use dotenv you know the usage so just edit it
electric
electric3d ago
I edited it but hm
No description
electric
electric3d ago
No description
treble/luna
treble/luna3d ago
code and error do not match ./dotenv is indeed not a module dotenv is
electric
electric3d ago
what should I do nvm
treble/luna
treble/luna3d ago
find where you used ./dotenv because its not a local file
electric
electric3d ago
I have a slash command coded but
No description
treble/luna
treble/luna3d ago
then look at how you load your commands
electric
electric3d ago
worked for a sec and new error
No description
treble/luna
treble/luna3d ago
one or more of your commands do not have a name
electric
electric3d ago
don't believe so
No description
electric
electric3d ago
(i have one slash command only for now for testing)
treble/luna
treble/luna3d ago
i am more inclined to believe the api over you log before you deploy
electric
electric3d ago
i did tho..
treble/luna
treble/luna3d ago
then show it
electric
electric3d ago
No description
treble/luna
treble/luna3d ago
i highly doubt that is your command
electric
electric3d ago
wdym
treble/luna
treble/luna3d ago
thats the error log your command
electric
electric3d ago
mb
No description
treble/luna
treble/luna3d ago
is your code saved show the full code if so
electric
electric3d ago
ya index or everything or the ping
treble/luna
treble/luna3d ago
where you deploy your commands most likely your deploy-commands file
electric
electric3d ago
okay
electric
electric3d ago
Pastebin
deploy-commands - 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/luna3d ago
why are you hardcoding your commands to then push other commands into it the deploy script is meant to be dynamic
electric
electric3d ago
it is dynamic tho i didn't hardcode them
treble/luna
treble/luna3d ago
yeah sure its dynamic for most part
electric
electric3d ago
it's an arrray
treble/luna
treble/luna3d ago
...which you hardcoded your ping command into
electric
electric3d ago
i can add more as i add more slash commands well what should I do then
treble/luna
treble/luna3d ago
you quite literally have code that loads your commands do you even know what your code does
electric
electric3d ago
kinda i get the idea
treble/luna
treble/luna3d ago
then you should know that line 11-23 load your commands and that you shouldnt hardcode
electric
electric3d ago
but it could be anything there, if added let's say user slash cmd, i add it to the array itd still work won't it or im wrong
treble/luna
treble/luna3d ago
no because youre putting your entire command in there not the builder itself which is what lines 11-23 do
electric
electric3d ago
so what should i define commands as empty array? but it won't work
treble/luna
treble/luna3d ago
then you have to take a look at how you are loading your commands your folder structure thus based on your imports, your commands are in the src folder which your code never checks