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