#I thought it's a default thing?

111 messages · Page 1 of 1 (latest)

leaden tide
#

Why is it an error, I don't understand

vale kettleBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
trail cedar
#

you dont have such a folder

#

make sure your pathing is correct

leaden tide
#

how about this

#

tryna made a slash command

#

but all my files don't have application id

trail cedar
#

you provided undefined where an application and/or guild id is needed

leaden tide
#

I have guild ID

#

but it somehow doesn't work

trail cedar
#

you also need the client id

leaden tide
trail cedar
#

then pass it in

leaden tide
#

I did

trail cedar
#

show how

leaden tide
#

put in config.json and .env

trail cedar
#

why do you have both

#

you pick one

#

not both

leaden tide
#

the guide told me to use config.json but I had .env

#

so i created both eventually

trail cedar
#

then use .env

#

the guide shows example on both

#

it does not mean use both

leaden tide
#

does it work if i do this

trail cedar
#

..no

#

the guide shows how to work with dotenv

leaden tide
#

it doesn't when it comes to registration

trail cedar
trail cedar
#

then edit that to use dotenv

#

its a guide

#

its meant to guide you, not 'copy paste and go'

leaden tide
#

start from the first or

#

continue

#

since the fundaments are here

trail cedar
#

do you know js

leaden tide
trail cedar
#

then it shouldnt be too hard to edit that to use dotenv

#

you know the usage

#

so just edit it

leaden tide
trail cedar
#

code and error do not match

#

./dotenv is indeed not a module

#

dotenv is

leaden tide
#

nvm

trail cedar
#

find where you used ./dotenv

#

because its not a local file

leaden tide
#

I have a slash command coded but

trail cedar
#

then look at how you load your commands

leaden tide
trail cedar
#

one or more of your commands do not have a name

leaden tide
#

(i have one slash command only for now for testing)

trail cedar
#

i am more inclined to believe the api over you

#

log before you deploy

leaden tide
trail cedar
#

then show it

leaden tide
trail cedar
#

i highly doubt that is your command

leaden tide
trail cedar
#

thats the error

#

log your command

leaden tide
trail cedar
#

is your code saved

#

show the full code if so

leaden tide
leaden tide
#

everything

#

or the ping

trail cedar
#

where you deploy your commands

#

most likely your deploy-commands file

leaden tide
#

okay

leaden tide
trail cedar
#

why are you hardcoding your commands

#

to then push other commands into it

#

the deploy script is meant to be dynamic

leaden tide
#

i didn't hardcode them

trail cedar
#

yeah sure its dynamic for most part

leaden tide
#

it's an arrray

trail cedar
#

...which you hardcoded your ping command into

leaden tide
#

i can add more as i add more slash commands

#

well

#

what should I do then

trail cedar
#

you quite literally have code that loads your commands

#

do you even know what your code does

leaden tide
#

kinda

#

i get the idea

trail cedar
#

then you should know that line 11-23 load your commands

#

and that you shouldnt hardcode

leaden tide
#

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

trail cedar
#

no because youre putting your entire command in there

#

not the builder itself

#

which is what lines 11-23 do

leaden tide
#

so what should i define commands as

#

empty array?

#

but it won't work

trail cedar
#

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