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

140
Views
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 answers
Answer question

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 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!