From 23e32b90f0ba839d9760ada4238ed0e4fb4e03a1 Mon Sep 17 00:00:00 2001 From: Alex Brow Date: Wed, 19 Feb 2020 20:17:30 -0500 Subject: [PATCH] Perms for say because we cant have nice things. --- src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 367dabb..489cd12 100755 --- a/src/index.js +++ b/src/index.js @@ -75,13 +75,16 @@ client.on("message", async message => { const sayMessage = args.join(" "); if(sayMessage.includes('@')) return message.reply("\nStop pinging yourself \nStop pinging yourself"); - else{ + else if (!message.member.roles.some(r=>["Admin", "Mods","Member of the Order of the b l u e","Botmeister","Ally of the Order"].includes(r.name)) ) { // Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing. message.delete().catch(O_o=>{}); // And we get the bot to say the thing: - message.channel.send(sayMessage); + return message.channel.send(sayMessage); + } + else { + return message.channel.send("Im sorry but we cant have nice things...") + } } - } if(command === "kick") { // This command must be limited to mods and admins. In this example we just hardcode the role names.