mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-22 08:45:55 +00:00
verification: send msg in general annoucning user has joined
This commit is contained in:
parent
abf7b6fb6d
commit
bb49397ad5
1 changed files with 15 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue