const Discord = require('discord.js'); const client = new Discord.Client({ intents: [ Discord. Intents. FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES ] }); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on('message', msg => { if (msg.content === 'ping') { msg.reply('**pong!**'); } }); client.login('token');