Recently, I have made a Discord bot using node.js and VS Code. I can see my bot being online. However, it does not respond to my messages. (The bot has the required permissions.)
I could not understand the problem, I would be so delighted if you gave me a hand.
Here is my bot.js code
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const config = require("./config.json");
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message' , message => {
if(message === 'ping') {
message.channel.send('Pong!');
}
})
client.login(config.token);
Here is my config.json code
{
"token": "I wrote my token in here"
}