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,