how does discord.js work code example
Example 1: discord.js
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', message => {
if (message.content === 'ping') {
message.channel.send('Pong!');
}
});
client.login('token');
Example 2: discord.js
npm i discord.js