Skip to content

Commit

Permalink
Remove "old verified" for everyone verifying
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjaneb committed Sep 22, 2024
1 parent 3c00a44 commit bb43b74
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/commands/verify/subcommands/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ export const verifyUser = async (
const { year, yearRole } = await extractYearFromUser(kthId);
const userHasYearRole = await hasAnyYearRole(user, guild);

if ((yearRole && year) || userHasYearRole) {
if (yearRole && year) {
await setYearRoles(user, yearRole, guild);
const alias = mapYearToAlias(year);
if (alias)
await handleChannelAlias(guild, user, alias, joinChannel);
}

if (await hasRole(user, "old verified", guild))
await removeRole(user, "old verified", guild);
} else setExternRole(user, guild);
if (yearRole && year) {
await setYearRoles(user, yearRole, guild);
const alias = mapYearToAlias(year);
if (alias)
await handleChannelAlias(guild, user, alias, joinChannel);
} else if (!userHasYearRole)
setExternRole(user, guild);

await setPingRoles(user, guild);

if (await hasRole(user, "old verified", guild))
await removeRole(user, "old verified", guild);
};

0 comments on commit bb43b74

Please sign in to comment.