From d3dd58da1700ba83ba1d49111a8f414a4064749f Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 5 Mar 2021 15:51:10 -0700 Subject: [PATCH] mods can use warn cmds --- commands/moderation/clearwarnings.js | 8 ++++---- commands/moderation/warn.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands/moderation/clearwarnings.js b/commands/moderation/clearwarnings.js index 474a6c4..40a96e4 100644 --- a/commands/moderation/clearwarnings.js +++ b/commands/moderation/clearwarnings.js @@ -9,17 +9,17 @@ module.exports = { category: 'Moderation', description: "Clear a user's warnings in your server.", syntax: '`clearwarnings <@user|userID>`', - extra: null + extra: null, + guildOnly: true }, help: new Discord.MessageEmbed() .setTitle("Help -> Warn Clearing") .setDescription("Clears the warnings of a user") .addField("Syntax", "`clearwarnings <@user|userID>`") - .addField("Notice", "You must be a server administrator in order to use this command."), + .addField("Notice", "You must be a server moderator in order to use this command."), async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}clearwarnings <@user|userID>\``);} - if (!message.guild) {return message.channel.send("This is a server-only command.");} - if (!message.member.permissions.has("ADMINISTRATOR")) {return message.reply("You must be a server administrator to use this command.");} + if (!message.member.permissions.has("MANAGE_MESSAGES") && !message.member.permissions.has("MANAGE_GUILD")) {return message.reply("You must be a server moderator (manage messages or manage server permissions) to use this command.");} let user = message.mentions.members.first() && args[0].match(/^<@(?:!)(?:\d+)>$/) ? message.mentions.members.first() : message.guild.members.cache.has(args[0]) ? message.guild.members.cache.get(args[0]) : null; if (!user) {return message.channel.send("Either you didn't mention a user, or I can't find that user!");} diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 60008aa..3f115e0 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -21,7 +21,7 @@ module.exports = { async execute(message, msg, args, cmd, prefix, mention, client) { if (!message.guild) {return message.channel.send("This is a server-only command.");} if (!args.length) {return message.channel.send(`Syntax: \`${prefix}warn <@member> \``);} - if (!message.member.permissions.has("ADMINISTRATOR")) {return message.reply("You must be a server administrator to use this command.");} + if (!message.member.permissions.has("MANAGE_MESSAGES") && !message.member.permissions.has("MANAGE_GUILD")) {return message.reply("You must be a server moderator (manage messages or manage server permissions) to use this command.");} if (args.length < 2 && !['check', 'c', 'list', 'l', 'clear', 'e', 'empty'].includes(args[0].toLowerCase())) {return message.channel.send("You must provide a reason for warning the user, or `check` or `clear`.");} let user = message.mentions.members.first() && args[0].match(/^<@(?:!)(?:\d+)>$/) ? message.mentions.members.first() : message.guild.members.cache.has(args[0]) ? message.guild.members.cache.get(args[0]) : null;