Skip to content

Commit

Permalink
Update giveroles.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
AHanadsaker authored Jan 25, 2024
1 parent 9312f86 commit acd5300
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/commands/giveroles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export class VerifyCommand extends Command {
registry.registerChatInputCommand((builder) => {
builder
.setName("giveroles")
.setDescription("Use this command to have your roles assigned using your VATSIM information.");
.setDescription(
"Use this command to have your roles assigned using your VATSIM information."
);
});
}

Expand Down Expand Up @@ -55,6 +57,9 @@ export class VerifyCommand extends Command {
};

let member = await interaction.guild?.members.fetch(uid);
member.roles.remove(
member.roles.cache.filter((role) => role.name != "Server Booster")
);
roles.push(await interaction.guild?.roles.fetch(config.base)); //VATSIMController for ZMA
if (member != null) {
//Convert VATSIM Rating Integer to String
Expand Down Expand Up @@ -135,9 +140,9 @@ export class VerifyCommand extends Command {
}
}

console.log(user.roles.length);
console.log(user.roles.length);

if (user.roles.length > 0) {
if (user.roles.length > 0) {
for (let i = 0; i < user.roles.length; i++) {
if (user.roles[i].facility == "ZAE") {
break;
Expand Down Expand Up @@ -174,7 +179,7 @@ export class VerifyCommand extends Command {
}
}
}

console.log(roles);

await member.roles.add(roles); //Add all roles in the roles[] array
Expand Down

0 comments on commit acd5300

Please sign in to comment.