I'm currently learning how to use discord.Js and I am facing an issue with my message.reply function not working as expected. I have set up an event for the bot to listen to messages, and when a message containing "hello" is sent, it should reply with "hello buddy". Here's the code snippet:
// Import required discord.js classes
const { Client, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');
// Create a new instance of the client
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
// Execute this code once the client is ready
client.once('ready', () => {
console.log('The Bot is ready');
});
client.on('messageCreate', (message) => {
if(message.content === 'hello') {
console.log('hello buddy')
}
})
// Log in to Discord using your client's token
client.login(token);