index.js
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS] }); // FLAGS.GUILD is required for the bot to work
client.once('ready', () => {
console.log('Bot is online!');
});
client.login(token);
config.json
{
"token": "put_your_token_here"
}