Home > Blockchain >  "node ." not working when trying to run Discord bot
"node ." not working when trying to run Discord bot

Time:11-22

Here's my code:

const Discord = require('discord.js');

const client = new Discord.Client();

client.once('ready', () => {
    console.log('<Bot Name> is online!');
});




client.login('<Token>');

The bot isn't coming online when I type "node ." into CMD. Any fixes?

CodePudding user response:

What you're missing are intents. Try adding this to you're code, if you use Discord v13.


const Discord = require('discord.js');

const intents = new Discord.Intents(513);

const client = new Discord.Client({ intents });

client.once('ready', () => {
    console.log('<Bot Name> is online!');
});




client.login('<Token>');
  • Related