Skip to content

Commit

Permalink
[Fix] Fixed guildMemberAdd event sending the welcome message twice!
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 18, 2021
1 parent 4fc315f commit 535646f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions events/guildMemberAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ module.exports = {
}! :partying_face:`,
embeds: [welcomeEmbed],
});
}
};

if (checkCustomChannel) {
const customchannel = guild.guild.channels.cache.find(
(channel) => channel.id === checkCustomChannel
);
sendWelcome(customchannel)
if (!customchannel) return;
return sendWelcome(customchannel);
}

if (guild.guild.systemChannel) {
sendWelcome(guild.guild.systemChannel)
return sendWelcome(guild.guild.systemChannel);
} else {
return;
}
Expand Down

0 comments on commit 535646f

Please sign in to comment.