Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda