Node js not starting
Hi, sorry if I do something wrong but I'm really new to this world. My problem is that I made a code for a bot in Visual Studio Code and the command "node index.js" in the terminal to make the bot go online and start nodejs doesn't work. I contacted the discord dev server and they invited me here, sorry if what I'm writing is not relevant with the topic of this channel. Here's the code and the discord.js version is 14.13.0.
27 Replies
- 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!
- ✅
Marked as resolved by staff[email protected]
V20.6.1
What you get in your console?
After write "node index.js"
Nothing, if I write
node index.js
and press enter it's like I didn't wrote anything
It re-appears the file path
One moment I'll show youUnknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Yeah I did I have it in visual studio code
Okay I will save it manually but if I do I solve th problem?
In the dev discord server they told me to change EventsClientready with ready instead but idk what it means
No I don't, I know a bit about programming but not in js. I'm sorry but I don't have much knowledge even of client, and something like that. I followed a guide on Google pass by pass, I can indicate it to you if you want to know what I did
As I said I come from discord dev server and they gave me the link for that guide
Yes
Of course, give me a minute
Okay, closing vstudiocode I clicked on file->save, is it okay or I have to save all the files separately?
I saved them separately but now visual studio code tells me that there are multiple problems on the code
It says that token is assigned a value but never used and that the strings must be use singoequote
Okay so you can confirm to me that the code is right and should work? If so and it doesn't work I will contact the discord devs again
Hi, sorry again, i implemented my code but i have this error, what you think the problem is?
You provided an invalid intent
Thanks, can I send you my intents list so you can tell me what is wrong?
The code is too long to be sent by message
for now you can just send your intents, so your
new Client({intents:[...]})
statementOkay I will, give me a minute
GatewayIntentBits.MessageReactionAdd
is not a real intent
maybe you wanted GatewayIntentBits.GuildMessageReactions
?Maybe, as I said it's an AI generated code as I don't know much of js so could be.
Same error I think
I tried
How can I send you the entire code? I cannot in this message because it's too long
Now it works
I saved the file and apparently works
To make a command to call the bot i have to insert it here after the /?
const prefix = '/';
You should not trust ai
Basic js knowledge is required as per #rules 3
Yeah I know I'm sorry I was invited to this server by discord devs and I started approaching developing in js recently
But I know a bit about programming so I'm not really in a bad situation
Well then you should follow the guide
Not ask ai to do it for you because then you'll end up like this
Okay thank you for helping, I can use the ai generated code as a base? I understand that maybe as chatGPT is outdated gives me the wrong code
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Use the guide
Okay guys thank you so much for helping:)