We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b93a4a6 + ab4c795 commit 02c2450Copy full SHA for 02c2450
controllers/users.js
@@ -324,8 +324,11 @@ const markUnverified = async (req, res) => {
324
});
325
326
usersInRdsDiscordServer.forEach((discordUser) => {
327
- const found = discordUser.roles.find((role) => role === discordDeveloperRoleId);
328
- if (found && !rdsUserMap[discordUser.user.id]) {
+ const isDeveloper = discordUser.roles.includes(discordDeveloperRoleId);
+ const isMissingUnverifiedRole = !discordUser.roles.includes(unverifiedRoleId);
329
+ const isUserUnverified = !rdsUserMap[discordUser.user.id]; // Doesn't have discordId in RDS user object
330
+
331
+ if (isDeveloper && isUserUnverified && isMissingUnverifiedRole) {
332
usersToApplyUnverifiedRole.push(discordUser.user.id);
333
}
334
0 commit comments