.setName is not a function

Hello, I cannot understand why it tells me that ".setName" is not a function.

Here is my code:

const {EmbedBuilder} = require('@discordjs/builders');
const {GuildMember, Embed} = require('discord.js');
const Schema = require('../../Models/Welcome')

module.exports = {
    name: "guildMemberAdd",
    async execute(member) {
        Schema.findOne({Guild: member.guild.id}, async (err, data) => {
            if (!data) return;
            let channel = data.Channel;
            let Msg = data.Msg || " ";
            let Role = data.Role;

            const {user, guild} = member;
            const welcomeChannel = member.guild.channels.cache.get(data.Channel);

            const welcomeEmbed = new EmbedBuilder()
            .setName("**Ho ! Un nouveau membre !**")
            .setDescription(data.Msg)
            .setColor(0x52D800)
            .addFields({name: 'Membres:', value: `${guild.memberCount}`})
            .setTimestamp();

            welcomeChannel.send({embeds: [welcomeEmbed]});
            member.roles.add(data.Role);

        })
    }
}


And here is my error:

Uncaught TypeError TypeError: (intermediate value).setName is not a function
    at <anonymous> (c:\Users\...\Desktop\...\Events\Guild\guildMemberAdd.js:18:14)
    at <anonymous> (c:\Users\...\Desktop\...\node_modules\mongoose\lib\model.js:4931:18)
    at processTicksAndRejections (internal/process/task_queues:77:11)


Thanks !
Was this page helpful?