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

142
Vistas
Welcome message when the discord.js bot joins

I changed the version from discord.js v12 to v13 and my bot join message doesn't work anymore.

    const { MessageEmbed, WebhookClient } = require("discord.js");
    const { channels } = require("../../app");
    const { prefix, color } = require("../../botconfig/config.json");

    module.exports = async (bot) => {

        bot.on('guildCreate', (guild) => {

            let channelToSendTo;

            guild.channels.forEach(channel => {
                if (channel.type === 'text' && !channelToSendTo && channel.permissionsFor(guild.me).has('SEND_MESSAGES')) channelToSendTo = channel;
            });

            if(!channelToSendTo) return;

            let newGuildEmbed = new MessageEmbed()
                .setColor(color)
                .setTitle(`<:Ela_E:888341177571639297> Thank you for adding me!`)
                .addField(`Premium`, `[Buy](https://elabot.top/premium)`, true)
                .addField(`Website`, `[Website Page](https://elabot.top)`, true)
                .addField(`Have questions?`, `[Join the support server](https://elabot.top/support)`, true)
            channelToSendTo.send(newGuildEmbed)

        })
        
    }

Error:

(node:15080) DeprecationWarning: The message event is deprecated. Use messageCreate instead (Use node --trace-deprecation ... to show where the warning was created)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In V13 sending embeds has changed. Change this line accordingly:

channelToSendTo.send(newGuildEmbed) //V12
channelToSendTo.send({embeds: [newGuildEmbed]}) //V13

Also, as it says in your error: The client.on('message') is deprecate. This has been changed to client.on('messageCreate')

If you bump into any new errors, please check the docs or the update instductions from V12 to V13

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