Skip to content

Commit

Permalink
debug: verbosity in /verify command
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-zang committed Jul 26, 2024
1 parent 836be1e commit cab02c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ Utils.handleCommandError = async ({error, message, command, info}, returnMessage
}

Utils.processVerification = async (verifyData, discordUser, revert=false, unsetNickOnRevert=true) => {
console.log(`${discordUser.user.tag} verification processing.`);
try {
if(revert) {
await discordUser.roles.remove(process.env.VERIFIED_ROLE_ID, "Reverting user verification.");
}
else {
await discordUser.roles.add(process.env.VERIFIED_ROLE_ID, "Verified user.");
console.log(`${discordUser.user.tag} verified role given.`);
}
}
catch(ignored){
Expand All @@ -105,6 +107,7 @@ Utils.processVerification = async (verifyData, discordUser, revert=false, unsetN
}
else {
await discordUser.roles.add(rolesMap[role], "Adding aux. roles on verify.");
console.log(`${discordUser.user.tag} role ${rolesMap[role]} given.`);
}
}
}
Expand All @@ -124,6 +127,7 @@ Utils.processVerification = async (verifyData, discordUser, revert=false, unsetN
}
else {
await discordUser.setNickname(`${verifyData.firstName} ${verifyData.lastName}`, "Setting user info on verify.");
console.log(`${discordUser.user.tag} nickname changed to ${verifyData.firstName} ${verifyData.lastName}.`);
}
}
}
Expand Down

0 comments on commit cab02c1

Please sign in to comment.