From 5b98166a2ba1648839bb41e39b1d99cb46cd8e46 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sat, 13 Mar 2021 04:30:16 +0100 Subject: [PATCH] Add check for permissions on prefix command Now only people with the MANAGE_GUILD permission can edit the prefix of that specific server. --- commands/prefix.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/prefix.js b/commands/prefix.js index b48ea10..827beea 100644 --- a/commands/prefix.js +++ b/commands/prefix.js @@ -1,9 +1,14 @@ +const parseMention = require("../util/parseMention"); const setServerPrefix = require("../util/setServerPrefix"); module.exports = { name: 'prefix', description: 'Change the prefix of the bot in this server.', execute({ message, client, args, prefix }) { + if (!message.member.hasPermission('MANAGE_GUILD')) { + message.channel.send("You do not have sufficient permissions(MANAGE_GUILD) to change the prefix of this server") + return; + } if (!args[0]) { message.channel.send(`To change the prefix, execute \`${prefix}prefix \``); return;