removed discordjs/builders, worked on help
diff --git a/src/commands/role/user.ts b/src/commands/role/user.ts
index ad29811..4ec7f3e 100644
--- a/src/commands/role/user.ts
+++ b/src/commands/role/user.ts
@@ -1,5 +1,5 @@
import type { CommandInteraction, GuildMember, Role, User } from "discord.js";
-import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "discord.js";
import client from "../../utils/client.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -78,8 +78,11 @@
});
};
-const check = (interaction: CommandInteraction) => {
+const check = (interaction: CommandInteraction, partial: boolean = false) => {
const member = interaction.member as GuildMember;
+ // Check if the user has manage_roles permission
+ if (!member.permissions.has("ManageRoles")) return "You do not have the *Manage Roles* permission";
+ if (partial) return true;
if (!interaction.guild) return
const me = interaction.guild.members.me!;
const apply = interaction.options.getMember("user") as GuildMember | null;
@@ -88,8 +91,6 @@
if (!me.permissions.has("ManageRoles")) return "I do not have the *Manage Roles* permission";
// Allow the owner to role anyone
if (member.id === interaction.guild.ownerId) return true;
- // Check if the user has manage_roles permission
- if (!member.permissions.has("ManageRoles")) return "You do not have the *Manage Roles* permission";
// Allow role
return true;
};