This is my main.js file, I've searched through it and looked to see if there are any mistakes, and I've tried using different solutions I found here and in some of the comments of the tutorial I used, but nothing worked.
UPDATE: I've decided to just remove the embed.js file permanently for now, and for some reason none of my commands are working. (I only have one command.) It's the same error message, nothing has changed and I don't know what's causing the problem.
I have tried replacing client.on('message', message => { with client.on('messageCreate', message => { as the comments said but to no avail, the bot wouldn't even respond. At this point, I'm stumped.
And yes, I'm using the latest version of Node.js and Discord.js v13. I have no idea why this isn't working.
const Discord = require('discord.js');
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });
const prefix = '/';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles){
const command = require(`./commands/${file}`)
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('BotOnlineStatus = True');
});
client.on('message', message => {
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'command'){
client.commands.get('command').execute(message, args, Discord);
}
});
client.login('*CENSORED*')
This is the error I keep receiving. I don't why I keep receiving this error, tried to fix it so many times but it's still busted. (I have very limited coding experience on Discord, so yeah.)
admins-iMac:DiscordBot admin$ node main.js
BotOnlineStatus = True
(node:22655) DeprecationWarning: The message event is deprecated. Use messageCreate instead
(Use `node --trace-deprecation ...` to show where the warning was created)
If anyone has any solutions, please let me know.
It is not an error, it is a warning.
Read the warning.
The message event is deprecated. Use messageCreate instead
client.on('message', to client.on('messageCreate',The message event has been renamed to messageCreate.
I think this error is not stopping your bot ya ?
Anyway try to replace client.on('message', message => {
By client.on('messageCreate', message => {