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
d.js toolkit
d.js toolkit2d 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!
monbrey
monbrey2d ago
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?
Heph
Heph2d ago
You replace 'YOUR_BOT_TOKEN' with the token of your bot...
Viish
Viish18h ago
YOUR_BOT_TOKEN with your bot token and to get your own bot token visit https://discord.com/developers/applications
stanley
stanleyOP8h ago
The console gives me an error, even when I put the bot token
Amgelo
Amgelo8h ago
show the error
stanley
stanleyOP8h ago
No description
stanley
stanleyOP8h ago
That's another mistake I already solved the previous one, I had to change everything
Amgelo
Amgelo8h ago
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
stanley
stanleyOP8h ago
The file supposedly exists, but it does not detect it
Amgelo
Amgelo8h ago
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
stanley
stanleyOP8h ago
well, thanks

Did you find this page helpful?