diff options
Diffstat (limited to 'src/commands/moderation')
-rw-r--r-- | src/commands/moderation/ban.ts | 4 | ||||
-rw-r--r-- | src/commands/moderation/kick.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/mute.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/role.ts | 8 | ||||
-rw-r--r-- | src/commands/moderation/unmute.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/warn.ts | 2 |
6 files changed, 11 insertions, 9 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 812d7ca..fea5543 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -122,14 +122,14 @@ export default class BanCommand extends BushCommand { const responseCode = member ? await member.bushBan({ reason: parsedReason, - moderator: message.author, + moderator: message.member, duration: time! ?? 0, deleteDays: days ?? 0 }) : await message.guild.bushBan({ user, reason: parsedReason, - moderator: message.author, + moderator: message.member, duration: time! ?? 0, deleteDays: days ?? 0 }); diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index e7f9708..07c25ab 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -75,7 +75,7 @@ export default class KickCommand extends BushCommand { const responseCode = await member.bushKick({ reason, - moderator: message.author + moderator: message.member }); const responseMessage = () => { diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 849873e..fba548b 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -86,7 +86,7 @@ export default class MuteCommand extends BushCommand { const responseCode = await member.mute({ reason: parsedReason, - moderator: message.author, + moderator: message.member, duration: time! ?? 0 }); 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.`; diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index 3383583..ee4bebe 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -77,7 +77,7 @@ export default class UnmuteCommand extends BushCommand { const responseCode = await member.unmute({ reason, - moderator: message.author + moderator: message.member }); const responseMessage = async () => { diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 0fa83f3..44f4f5a 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -71,7 +71,7 @@ export default class WarnCommand extends BushCommand { const { result: response, caseNum } = await member.warn({ reason, - moderator: message.author + moderator: message.member }); switch (response) { |