From da4a209b9b3e7f3679c571f95a4f726f7aee9e84 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 4 Apr 2021 23:01:32 -0500 Subject: [PATCH] Return on ban and kick if member does not have admin priveleges --- bot.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bot.js b/bot.js index 1aa749e..5e0a517 100644 --- a/bot.js +++ b/bot.js @@ -414,6 +414,10 @@ async function addRole(message) { } async function ban(message) { + if (!message.member.hasPermission('ADMINISTRATOR')) { + message.reply('you do not have admin privileges!') + return; + } if (!message.content.split(" ")[1]) { message.reply("query must contain at least 3 characters!") @@ -467,6 +471,10 @@ async function ban(message) { } async function kick(message) { + if (!message.member.hasPermission('ADMINISTRATOR')) { + message.reply('you do not have admin privileges!') + return; + } if (!message.content.split(" ")[1]) { message.reply("query must contain at least 3 characters!")