Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
I've been trying to make a Discord bot, but when I got to the embeds, some error keeps appearing. I've tried everything, and nothing works

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.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

  1. It is not an error, it is a warning.

  2. Read the warning.

The message event is deprecated. Use messageCreate instead

  1. Change client.on('message', to client.on('messageCreate',
about 4 years ago · Juan Pablo Isaza Report

0

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 => {

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!