Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

131
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda