diff --git a/cmds/moderation/ban.js b/cmds/moderation/ban.js index edb7d0e..6587f65 100644 --- a/cmds/moderation/ban.js +++ b/cmds/moderation/ban.js @@ -15,9 +15,7 @@ module.exports = class ban extends commando.Command { memberName: "ban", group: "moderation", description: "Ban pesky troll and toxic members", - guildOnly: true, - userPermissions: ["BAN_MEMBERS"], - clientPermissions: ["BAN_MEMBERS"] + guildOnly: true }); } @@ -27,6 +25,9 @@ module.exports = class ban extends commando.Command { * @returns */ async run(msg, arg) { + const CL = msg.guild.member(msg.client.user); + if (!(msg.member.idAdmin || msg.member.hasPermission("BAN_MEMBER"))) return trySend(msg.client, msg, "bruh moment <:nekokekLife:852865942530949160>"); + if (!(CL.idAdmin || CL.hasPermission("BAN_MEMBER"))) return trySend(msg.client, msg, "I don't have the power to do that <:pepewhysobLife:853237646666891274>"); if (!arg) return trySend(msg.client, msg, "Args: `user_[name|mention|ID] -- [reason] -- [duration] [--d [number of days to delete messages of the user to ban]]`. Separate `user` with `,`. Example:" + `\`\`\`js\n${msg.guild.commandPrefix + this.name diff --git a/cmds/moderation/mute.js b/cmds/moderation/mute.js index b2bc5db..5f2c38c 100644 --- a/cmds/moderation/mute.js +++ b/cmds/moderation/mute.js @@ -55,9 +55,7 @@ module.exports = class mute extends commando.Command { `You can view server as the newly created mute role and override my default settings later.\n` + `Example:\`\`\`\n--s -r muted -d 69y420mo36w49d69h4m420s\n` + `--s -r none -d 0\n--cmr -n Muted -c black\`\`\``, - guildOnly: true, - userPermissions: ['MANAGE_ROLES'], - clientPermissions: ['MANAGE_ROLES'] + guildOnly: true }); } /** @@ -66,6 +64,9 @@ module.exports = class mute extends commando.Command { * @returns */ async run(msg, arg) { + const CL = msg.guild.member(msg.client.user); + if (!(msg.member.idAdmin || msg.member.hasPermission("MANAGE_ROLES"))) return trySend(msg.client, msg, "Who are you <:nekohmLife:846371737644957786>"); + if (!(CL.idAdmin || CL.hasPermission("MANAGE_ROLES"))) return trySend(msg.client, msg, "I don't have the power to do that <:pepewhysobLife:853237646666891274>"); msg.channel.startTyping(); if (!msg.guild.DB) await msg.guild.dbLoad(); const MOD = msg.guild.DB.settings, diff --git a/cmds/moderation/unban.js b/cmds/moderation/unban.js index e6cbc34..fcd9ca5 100644 --- a/cmds/moderation/unban.js +++ b/cmds/moderation/unban.js @@ -9,12 +9,14 @@ module.exports = class unbanCmd extends commando.Command { memberName: "unban", group: "moderation", description: "Unban user from your server", - userPermissions: ["ADMINISTRATOR"], - clientPermissions: ["ADMINISTRATOR"] + guildOnly: true }); } async run(msg, arg) { + const CL = msg.guild.member(msg.client.user); + if (!(msg.member.idAdmin || msg.member.hasPermission("ADMINISTRATOR"))) return trySend(msg.client, msg, "are they your friend? <:nekokekLife:852865942530949160>"); + if (!(CL.idAdmin || CL.hasPermission("ADMINISTRATOR"))) return trySend(msg.client, msg, "I don't have the power to do that <:pepewhysobLife:853237646666891274>"); if (!arg) return trySend(msg.client, msg, "Provide `user_ID` to unban. Separate `user` with `,`. Example:```js\n" + `${msg.guild.commandPrefix + this.name} 757453290714824844, 706039105540194314, 198558078508072960 ` + `-- sent me some nice materials for tonight\`\`\``); diff --git a/cmds/moderation/unmute.js b/cmds/moderation/unmute.js index 61ce2bb..a16e562 100644 --- a/cmds/moderation/unmute.js +++ b/cmds/moderation/unmute.js @@ -1,7 +1,7 @@ 'use strict'; const commando = require("@iceprod/discord.js-commando"); -const { parseDoubleDash, trySend, defaultImageEmbed, parseComa, defaultEventLogEmbed } = require("../../resources/functions"); +const { parseDoubleDash, trySend, parseComa, defaultEventLogEmbed } = require("../../resources/functions"); const targetUser = require("./src/targetUser"); module.exports = class unmute extends commando.Command { @@ -11,13 +11,14 @@ module.exports = class unmute extends commando.Command { memberName: "unmute", group: "moderation", description: "Mute.", - guildOnly: true, - userPermissions: ['MANAGE_ROLES'], - clientPermissions: ['MANAGE_ROLES'] + guildOnly: true }); } async run(msg, arg) { + const CL = msg.guild.member(msg.client.user); + if (!(msg.member.idAdmin || msg.member.hasPermission("MANAGE_ROLES"))) return trySend(msg.client, msg, "no <:nekohmLife:846371737644957786>"); + if (!(CL.idAdmin || CL.hasPermission("MANAGE_ROLES"))) return trySend(msg.client, msg, "I don't have the power to do that <:pepewhysobLife:853237646666891274>"); if (!msg.guild.DB) await msg.guild.dbLoad(); msg.channel.startTyping(); if (!arg) return trySend(msg.client, msg, "Provide `user_ID` to unmute. Separate `user` with `,`. Example:```js\n" +