From 69d91d3a1e62fc1062cbbf95d44243f1c11ba6c5 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 9 May 2022 23:58:57 +0300 Subject: [PATCH] client permissions --- src/structure/components/commands/moderation/Ban.js | 1 + src/structure/components/commands/moderation/Case.js | 1 + src/structure/components/commands/moderation/Dehoist.js | 1 + src/structure/components/commands/moderation/History.js | 1 + src/structure/components/commands/moderation/Kick.js | 3 ++- src/structure/components/commands/moderation/Lockdown.js | 1 + src/structure/components/commands/moderation/Modtimers.js | 1 + src/structure/components/commands/moderation/Mute.js | 3 ++- src/structure/components/commands/moderation/Nickname.js | 1 + src/structure/components/commands/moderation/Prune.js | 3 ++- src/structure/components/commands/moderation/Roles.js | 1 + src/structure/components/commands/moderation/Slowmode.js | 1 + src/structure/components/commands/moderation/Softban.js | 1 + src/structure/components/commands/moderation/Staff.js | 2 +- src/structure/components/commands/moderation/Unban.js | 1 + src/structure/components/commands/moderation/Unlockdown.js | 1 + src/structure/components/commands/moderation/Unmute.js | 1 + 17 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/structure/components/commands/moderation/Ban.js b/src/structure/components/commands/moderation/Ban.js index 7c854c9..1a6d232 100644 --- a/src/structure/components/commands/moderation/Ban.js +++ b/src/structure/components/commands/moderation/Ban.js @@ -29,6 +29,7 @@ class BanCommand extends ModerationCommand { showUsage: true, guildOnly: true, memberPermissions: ['BAN_MEMBERS'], + clientPermissions: ['BAN_MEMBERS'], skipOptions: ['prune'] }); diff --git a/src/structure/components/commands/moderation/Case.js b/src/structure/components/commands/moderation/Case.js index badbe0b..f7c92c2 100644 --- a/src/structure/components/commands/moderation/Case.js +++ b/src/structure/components/commands/moderation/Case.js @@ -27,6 +27,7 @@ class CaseCommand extends SlashCommand { }], guildOnly: true, showUsage: true, + clientPermissions: ['MANAGE_MESSAGES'], memberPermissions: ['MANAGE_MESSAGES'] }); } diff --git a/src/structure/components/commands/moderation/Dehoist.js b/src/structure/components/commands/moderation/Dehoist.js index 5107e23..19f79c4 100644 --- a/src/structure/components/commands/moderation/Dehoist.js +++ b/src/structure/components/commands/moderation/Dehoist.js @@ -10,6 +10,7 @@ class DehoistCommand extends ModerationCommand { module: 'moderation', options: [ ], memberPermissions: ['MANAGE_NICKNAMES'], + clientPermissions: ['MANAGE_NICKNAMES'], guildOnly: true }); diff --git a/src/structure/components/commands/moderation/History.js b/src/structure/components/commands/moderation/History.js index 6b0f7c0..eb10da4 100644 --- a/src/structure/components/commands/moderation/History.js +++ b/src/structure/components/commands/moderation/History.js @@ -19,6 +19,7 @@ class HistoryCommand extends SlashCommand { description: 'List past infractions', module: 'moderation', memberPermissions: ['MANAGE_MESSAGES'], + clientPermissions: ['EMBED_LINKS'], guildOnly: true, options: [{ name: ['before', 'after'], diff --git a/src/structure/components/commands/moderation/Kick.js b/src/structure/components/commands/moderation/Kick.js index 75ad3dc..61152b8 100644 --- a/src/structure/components/commands/moderation/Kick.js +++ b/src/structure/components/commands/moderation/Kick.js @@ -11,7 +11,8 @@ class KickCommand extends ModerationCommand { options: [], guildOnly: true, showUsage: true, - memberPermissions: ['KICK_MEMBERS'] + memberPermissions: ['KICK_MEMBERS'], + clientPermissions: ['KICK_MEMBERS'], }); } diff --git a/src/structure/components/commands/moderation/Lockdown.js b/src/structure/components/commands/moderation/Lockdown.js index c0aecf1..6b1ab7e 100644 --- a/src/structure/components/commands/moderation/Lockdown.js +++ b/src/structure/components/commands/moderation/Lockdown.js @@ -21,6 +21,7 @@ class LockdownCommand extends ModerationCommand { guildOnly: true, showUsage: true, memberPermissions: ['MANAGE_CHANNELS'], + clientPermissions: ['MANAGE_CHANNELS'], skipOptions: ['users'] }); diff --git a/src/structure/components/commands/moderation/Modtimers.js b/src/structure/components/commands/moderation/Modtimers.js index dfaf850..e5169d2 100644 --- a/src/structure/components/commands/moderation/Modtimers.js +++ b/src/structure/components/commands/moderation/Modtimers.js @@ -8,6 +8,7 @@ class ModtimersCommand extends SlashCommand { description: 'List active timed infractions', module: 'moderation', memberPermissions: ['MANAGE_MESSAGES'], + clientPermissions: ['EMBED_LINKS'], guildOnly: true }); } diff --git a/src/structure/components/commands/moderation/Mute.js b/src/structure/components/commands/moderation/Mute.js index 5d281a0..99ca2b9 100644 --- a/src/structure/components/commands/moderation/Mute.js +++ b/src/structure/components/commands/moderation/Mute.js @@ -15,7 +15,8 @@ class MuteCommand extends ModerationCommand { }], guildOnly: true, showUsage: true, - memberPermissions: ['MODERATE_MEMBERS'] + memberPermissions: ['MODERATE_MEMBERS'], + clientPermissions: ['MODERATE_MEMBERS', 'MANAGE_ROLES'] // Mute client permissions are handled in the infraction.verify due to being able to use both timeout and role based mutes }); } diff --git a/src/structure/components/commands/moderation/Nickname.js b/src/structure/components/commands/moderation/Nickname.js index 22d30f4..709f72d 100644 --- a/src/structure/components/commands/moderation/Nickname.js +++ b/src/structure/components/commands/moderation/Nickname.js @@ -14,6 +14,7 @@ class NicknameCommand extends ModerationCommand { type: 'STRING' }], memberPermissions: ['MANAGE_NICKNAMES'], + clientPermissions: ['MANAGE_NICKNAMES'], guildOnly: true }); diff --git a/src/structure/components/commands/moderation/Prune.js b/src/structure/components/commands/moderation/Prune.js index e2b76fb..51e9538 100644 --- a/src/structure/components/commands/moderation/Prune.js +++ b/src/structure/components/commands/moderation/Prune.js @@ -84,7 +84,8 @@ class PruneCommand extends ModerationCommand { overrideOptions: true, guildOnly: true, showUsage: true, - memberPermissions: ['MANAGE_CHANNELS'] + memberPermissions: ['MANAGE_CHANNELS'], + clientPermissions: ['MANAGE_MESSAGES'], }); } diff --git a/src/structure/components/commands/moderation/Roles.js b/src/structure/components/commands/moderation/Roles.js index 0d470a4..d5ce009 100644 --- a/src/structure/components/commands/moderation/Roles.js +++ b/src/structure/components/commands/moderation/Roles.js @@ -28,6 +28,7 @@ class AddroleCommand extends ModerationCommand { }, ], memberPermissions: ['MANAGE_ROLES'], + clientPermissions: ['MANAGE_ROLES'], skipOptions: ['points', 'expiration', 'force', 'prune'] }); diff --git a/src/structure/components/commands/moderation/Slowmode.js b/src/structure/components/commands/moderation/Slowmode.js index f85ee8e..ab60e6d 100644 --- a/src/structure/components/commands/moderation/Slowmode.js +++ b/src/structure/components/commands/moderation/Slowmode.js @@ -10,6 +10,7 @@ class SlowmodeCommand extends ModerationCommand { showUsage: true, guildOnly: true, memberPermissions: ['MANAGE_CHANNELS'], + clientPermissions: ['MANAGE_CHANNELS'], options: [ { name: 'channels', diff --git a/src/structure/components/commands/moderation/Softban.js b/src/structure/components/commands/moderation/Softban.js index 85f3a58..ac7e05f 100644 --- a/src/structure/components/commands/moderation/Softban.js +++ b/src/structure/components/commands/moderation/Softban.js @@ -9,6 +9,7 @@ class SoftbanCommand extends ModerationCommand { module: 'moderation', description: 'Remove member from server and purge messages', memberPermissions: ['KICK_MEMBERS'], + clientPermissions: ['KICK_MEMBERS'], options: [{ name: 'days', type: 'INTEGER', diff --git a/src/structure/components/commands/moderation/Staff.js b/src/structure/components/commands/moderation/Staff.js index 1bdd142..09e88dd 100644 --- a/src/structure/components/commands/moderation/Staff.js +++ b/src/structure/components/commands/moderation/Staff.js @@ -8,7 +8,7 @@ class StaffCommand extends SlashCommand { description: 'Summon staff', module: 'moderation', guildOnly: true, - clientPermissions: ['MENTION_EVERYONE'] + clientPermissions: ['MENTION_EVERYONE', 'EMBED_LINKS'] }); } diff --git a/src/structure/components/commands/moderation/Unban.js b/src/structure/components/commands/moderation/Unban.js index f540dba..bccebb6 100644 --- a/src/structure/components/commands/moderation/Unban.js +++ b/src/structure/components/commands/moderation/Unban.js @@ -9,6 +9,7 @@ class UnbanCommand extends ModerationCommand { module: 'moderation', description: 'Remove member from server and purge messages', memberPermissions: ['BAN_MEMBERS'], + clientPermissions: ['BAN_MEMBERS'], options: [{ name: 'users', type: 'USERS', diff --git a/src/structure/components/commands/moderation/Unlockdown.js b/src/structure/components/commands/moderation/Unlockdown.js index e5e4b21..3647d3c 100644 --- a/src/structure/components/commands/moderation/Unlockdown.js +++ b/src/structure/components/commands/moderation/Unlockdown.js @@ -17,6 +17,7 @@ class UnlockdownCommand extends ModerationCommand { guildOnly: true, showUsage: true, memberPermissions: ['MANAGE_CHANNELS'], + clientPermissions: ['MANAGE_CHANNELS'], skipOptions: ['users'] }); diff --git a/src/structure/components/commands/moderation/Unmute.js b/src/structure/components/commands/moderation/Unmute.js index 592ed08..9eff319 100644 --- a/src/structure/components/commands/moderation/Unmute.js +++ b/src/structure/components/commands/moderation/Unmute.js @@ -12,6 +12,7 @@ class UnmuteCommand extends ModerationCommand { guildOnly: true, showUsage: true, memberPermissions: ['MODERATE_MEMBERS'], + clientPermissions: ['MANAGE_ROLES', 'MODERATE_MEMBERS'], skipOptions: ['points', 'expiration', 'prune', 'force'] }); }