fixed /user tracks & /settings tracks. Added presets to /server buttons
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index ee69868..92553ff 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -97,7 +97,8 @@
selected.length
} roles from this track. `;
conflictDropdown = [];
- if (roles.get(selected[0]!)!.position < memberRoles.highest.position || managed) {
+ const yourRoles = guild.members.cache.get(interaction.user.id)!.roles;
+ if ((roles.get(selected[0]!)!.position < yourRoles.highest.position && roles.get(selected[0]!)!.position < guild.members.me!.roles.highest.position!) || managed) {
generated +=
"In order to promote or demote this user, you must select which role the member should keep.";
selected.forEach((role) => {
@@ -115,8 +116,13 @@
.setPlaceholder("Select a role to keep")
];
} else {
- generated +=
- "You don't have permission to manage one or more of the users roles, and therefore can't select one to keep.";
+ if(roles.get(selected[0]!)!.position >= yourRoles.highest.position) {
+ generated +=
+ "You don't have permission to manage one or more of the user's roles, and therefore can't select one to keep.";
+ } else {
+ generated +=
+ "I don't have permission to manage one or more of the user's roles, and therefore can't select one to keep."
+ }
}
} else {
currentRoleIndex = selected.length === 0 ? -1 : data.track.indexOf(selected[0]!.toString());
@@ -183,6 +189,7 @@
const rolesToRemove = selected.filter(
(role) => role !== (component as StringSelectMenuInteraction).values[0]
);
+
await member.roles.remove(rolesToRemove);
} else if (component.customId === "promote") {
if (