.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);

})
}
}
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)
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 !
3 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
duck
duck2y ago
it's true, that's not a function were you looking for <EmbedBuilder>.setTitle()?
Heimdall.
Heimdall.OP2y ago
Ooooh my bad. I switched setName and setTitle Thank you a lot
Want results from more Discord servers?
Add your server