I need help
Can someone tell me what I need to replace with this?
const { Client, IntentsBitField } = require('discord.js');
const client = new Client({ intents: [IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMessages] });
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login('YOUR_BOT_TOKEN');
12 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!I dont understand your question. That is the minimum example code to create a login a bot
Thats the first thing you wrtte, what is there to replace?
You replace 'YOUR_BOT_TOKEN' with the token of your bot...
YOUR_BOT_TOKEN
with your bot token and to get your own bot token visit https://discord.com/developers/applicationsThe console gives me an error, even when I put the bot token
show the error
That's another mistake
I already solved the previous one, I had to change everything
the code causing the error is not the same that you shared
well show the new one
we need all the information to help you
the error and the code causing it
not one of them
though according to the error you're requiring a server.js file, which does not exist
The file supposedly exists, but it does not detect it
it should be in the same folder as your index.js
this is no longer djs related though
it's a node error
you can ask in #other-js-ts
well, thanks