verification: send msg in general annoucning user has joined

This commit is contained in:
Ayden Jahola 2024-09-09 15:24:10 +01:00
parent abf7b6fb6d
commit bb49397ad5
No known key found for this signature in database
GPG key ID: 71DD90AE4AE92742

View file

@ -84,16 +84,16 @@ module.exports = {
});
}
// Add the verified role to the member
await member.roles.add(role);
// Delete the verification code entry
await VerificationCode.deleteOne({ userId: interaction.user.id, code });
// Get the admin log channel
// Get the admin log channel and send a log message
const adminLogChannel = client.channels.cache.get(
process.env.LOG_CHANNEL_ID
);
if (adminLogChannel) {
// Send the log message
await adminLogChannel.send({
content: `🎉 **Verification Success**\nUser: <@${interaction.user.id}> (${interaction.user.tag})\nRole: ${role.name}`,
});
@ -101,6 +101,18 @@ module.exports = {
console.error("Admin log channel not found.");
}
// Get the general channel and send a welcome message
const generalChannel = client.channels.cache.get(
process.env.GENERAL_CHANNEL_ID
);
if (generalChannel) {
await generalChannel.send({
content: `Welcome <@${interaction.user.id}> to the server! 🎉`,
});
} else {
console.error("General channel not found.");
}
return interaction.reply({
content: `Congratulations <@${interaction.user.id}>, you have been verified!`,
ephemeral: true,