verification: include user's email address in the admin log chnnael upon successful verification

This commit is contained in:
Ayden Jahola 2024-09-29 02:37:01 +01:00
parent c06a7cd73e
commit 56c778d108
No known key found for this signature in database
GPG key ID: 71DD90AE4AE92742
4 changed files with 6 additions and 6 deletions

View file

@ -26,7 +26,7 @@ module.exports = {
)
.setTimestamp()
.setFooter({
text: `${serverName} || Made with ❤️ by Ayden`,
text: `${serverName} | Made with ❤️ by Ayden`,
iconURL: client.user.displayAvatarURL(),
});

View file

@ -26,7 +26,7 @@ module.exports = {
)
.setTimestamp()
.setFooter({
text: `${serverName} || Made with ❤️ by Ayden`,
text: `${serverName} | Made with ❤️ by Ayden`,
iconURL: client.user.displayAvatarURL(),
});

View file

@ -28,7 +28,7 @@ module.exports = {
)
.setTimestamp()
.setFooter({
text: `${serverName} || Made with ❤️ by Ayden`,
text: `${serverName} | Made with ❤️ by Ayden`,
iconURL: client.user.displayAvatarURL(),
});

View file

@ -47,7 +47,7 @@ module.exports = {
}
try {
// Find the verification code in the database
// Find the verification code and user email in the database
const verificationEntry = await VerificationCode.findOne({
userId: interaction.user.id,
code,
@ -104,13 +104,13 @@ module.exports = {
// Delete the verification code entry
await VerificationCode.deleteOne({ userId: interaction.user.id, code });
// Get the log channel and send a log message
// Get the log channel and send a log message, including the user's email
const adminLogChannel = client.channels.cache.get(
serverSettings.logChannelId
);
if (adminLogChannel) {
await adminLogChannel.send({
content: `🎉 **Verification Success**\nUser: <@${interaction.user.id}> (${interaction.user.tag})\nRole: ${role.name}`,
content: `🎉 **Verification Success**\nUser: <@${interaction.user.id}> (${interaction.user.tag})\nEmail: ${verificationEntry.email}\nRole: ${role.name}`,
});
} else {
console.error("Admin log channel not found.");