Skip to content

Commit

Permalink
Simplify statements
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Apr 6, 2021
1 parent 665dfb1 commit caa69c1
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -663,20 +663,19 @@ private Role getFoundRoleOrNull(CommandContext ctx) {
return null;
}

final Role.RoleTags tags = foundRole.getTags();
if (foundRole.isManaged()) {
final Role.RoleTags tags = foundRole.getTags();

if (tags.isBot()) {
sendMsg(ctx, "I cannot give this role to members because it belongs to <@" + tags.getBotIdLong() + '>');
} else if (tags.isBoost()) {
sendMsg(ctx, "I cannot give the boost role to members");
} else if (tags.isIntegration()) {
sendMsg(ctx, "I cannot give this role to members because it is managed by an integration (for example twitch subscriber roles)");
} else {
sendMsg(ctx, "This role cannot be used, but I don't know why (`unknown managed role`)");
}

if (tags.isBot()) {
sendMsg(ctx, "I cannot give this role to members because it belongs to <@" + tags.getBotIdLong() + '>');
return null;
}

if (tags.isBoost()) {
sendMsg(ctx, "I cannot give the boost role to members");
return null;
}

if (tags.isIntegration()) {
sendMsg(ctx, "I cannot give this role to members because it is managed by an integration (for example twitch subscriber roles)");
return null;
}

Expand Down

0 comments on commit caa69c1

Please sign in to comment.