#node .

81 messages · Page 1 of 1 (latest)

dawn lion
#

elaborate

vapid sparrowBOT
#

To help you we need more information:

  • What are you trying to do?
  • What is your code?
  • What errors and debug logs do you have?
jolly bridge
#

so im using visual studio code
im trying to code a discord bot.
java script
my error is node .
when i put the node . in the terminal of visual studio code it does absoulty nothing

dawn lion
#

run node -v

#

and try node <yourfilename>.js

jolly bridge
dawn lion
#

show the output

jolly bridge
#

and im in v18.16.1

jolly bridge
dawn lion
#

yes

jolly bridge
dawn lion
#

well make sure you're in the right directory

carmine nacelle
#

and make sure you actually typed the file name correctly

jolly bridge
#

the file name is Gentlemen Bot

carmine nacelle
#

then you typed the filename incorrectly

jolly bridge
#

i put GentlemenBot.js

carmine nacelle
#

you didn't

jolly bridge
carmine nacelle
#

you're missing the actual command node now...

jolly bridge
#

i swear i downloaded it correcrtly and its in my varibles

dawn lion
#

...

carmine nacelle
#

...

dawn lion
#

you just forgot to put node

#

just do like you did before but with the right filename

jolly bridge
#

so node.GentlemenBot.js ???

#

or nodeGentlemenBot.js

dawn lion
#

are you even trying at this point

#

you literally did it before

#

node <yourfile>.js

jolly bridge
#

i did

#

i literally did

dawn lion
#

and did it work

jolly bridge
#

no

dawn lion
#

and what error did you get

jolly bridge
dawn lion
#

are you even reading waht i say

#

there needs to be a space, node filename.js

jolly bridge
#

module not found

dawn lion
#

show your file structure

jolly bridge
dawn lion
#

you need to run index.js

#

and you just leaked your token. reset it

jolly bridge
#

alright

#

i reset it

#

rn

#

so i need to run the index correct?

dawn lion
#

yes

jolly bridge
#

in the terminal

dawn lion
#

yes

jolly bridge
#

i did that and a error pops up

dawn lion
#

which error

jolly bridge
#

it says index.js is not recognized

dawn lion
#

did you prefix it with node? We've literally just been over this

jolly bridge
#

yes and it says absolutly nothing

#

just goes to the next line

dawn lion
#

and do you have anything in your code that would log something

jolly bridge
#

not atm would you want to see the full code?

dawn lion
#

well then of course you wont get any output

jolly bridge
dawn lion
#

that activity setter is wrong thats one thing

#

and does the bot show up as online

jolly bridge
#

thats what this code is for to make it online

dawn lion
#

also access the client from the param that is passed in the ready event

jolly bridge
#

so no not yet

#

wdym?

dawn lion
#

ready passes in a client parameter, use that to set the activity

#

and can you run npm ls discord.js

jolly bridge
#

and what is wrong about the activity setter?

dawn lion
#

and what did it output

vapid sparrowBOT
jolly bridge
#

and now what?

dawn lion
#

Yeah

#

I highly doubt your code is saved at all

jolly bridge
#

how?

dawn lion
#

Its require, not Require, which would throw an error

#

please just check out #resources

jolly bridge
#

ok