From bb49397ad55f1e5177819d17e99f24ab4c0e0c54 Mon Sep 17 00:00:00 2001 From: Ayden Jahola Date: Mon, 9 Sep 2024 15:24:10 +0100 Subject: [PATCH] verification: send msg in general annoucning user has joined --- commands/verification/code.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/commands/verification/code.js b/commands/verification/code.js index d0162b1..d79977e 100644 --- a/commands/verification/code.js +++ b/commands/verification/code.js @@ -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,