aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/role.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/role.ts')
-rw-r--r--src/commands/moderation/role.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index 15af014..d0abb54 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -97,7 +97,11 @@ export default class RoleCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
{ action, user, role, duration }: { action: 'add' | 'remove'; user: BushGuildMember; role: BushRole; duration?: number }
): Promise<unknown> {
- if (!message.member!.permissions.has('MANAGE_ROLES')) {
+ if (
+ !message.member!.permissions.has('MANAGE_ROLES') &&
+ message.member!.id !== message.guild?.ownerId &&
+ !message.member!.user.isOwner()
+ ) {
const mappings = client.consts.mappings;
let mappedRole: { name: string; id: string };
for (let i = 0; i < mappings.roleMap.length; i++) {
@@ -134,8 +138,6 @@ export default class RoleCommand extends BushCommand {
const responseMessage = () => {
switch (responseCode) {
case 'user hierarchy':
- client.console.debug(role.position);
- client.console.debug(user.roles.highest.position);
return `${util.emojis.error} <@&${role.id}> is higher or equal to your highest role.`;
case 'role managed':
return `${util.emojis.error} <@&${role.id}> is managed by an integration and cannot be managed.`;