You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (role.isManaged() || role.isPublicRole() || role.getPosition() >= event.getGuild().getBotRole().getPosition()) {
51
+
event.replyEmbeds(EmbedUtils.createError("I cannot give out roles that have a higher position than me!")).setEphemeral(true).queue();
52
+
return;
53
+
}
54
+
if (configHandler.getConfig().getAutoRoles().size() >= 1 && !configHandler.isPremium()) {
55
+
event.replyEmbeds(EmbedUtils.createError("You can set multiple auto-roles with premium! For more info, use `/premium`.")).setEphemeral(true).queue();
56
+
return;
57
+
}
58
+
if (configHandler.getConfig().getAutoRoles().size() == MAX_AUTO_ROLES) {
59
+
event.replyEmbeds(EmbedUtils.createError("You have hit the maximum number of auto-roles for this guild!")).setEphemeral(true).queue();
60
+
return;
61
+
}
62
+
embed = EmbedUtils.createDefault(EmbedUtils.BLUE_TICK + " The <@&"+role.getId()+"> role will be given to all new members when they join the server.");
63
+
configHandler.addAutoRole(role.getIdLong());
64
+
}
65
+
case"remove" -> {
66
+
Rolerole = event.getOption("role").getAsRole();
67
+
if (!configHandler.getConfig().getAutoRoles().contains(role.getIdLong())) {
68
+
event.replyEmbeds(EmbedUtils.createError("The <@&"+role.getId()+"> role is not set as an auto-role.")).setEphemeral(true).queue();
69
+
return;
70
+
}
71
+
embed = EmbedUtils.createDefault(EmbedUtils.BLUE_X + " The <@&"+role.getId()+"> role will no longer be given to new members when they join the server.");
0 commit comments