Explorar o código

Add authorisation check for reactions

denikson %!s(int64=6) %!d(string=hai) anos
pai
achega
acc6208a03
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      main.js

+ 2 - 0
main.js

@@ -96,6 +96,7 @@ const commands = {
         );
     },
     "react to": (msg, s) => {
+        if (!isAuthorised(msg.member)) return;
         const pattern = /^react to\s+(\<[^\>]+\>)\s+with\s+\<:[^:]+:([^\>]+)\>$/i;
         let contents = pattern.exec(s);
         if(contents != null) {
@@ -110,6 +111,7 @@ const commands = {
         }
     },
     "remove reaction to": (msg, s) => {
+        if (!isAuthorised(msg.member)) return;
         let content = s.substring("remove reaction to ".length).trim();
         if(!db.get("messageReactions").has(content).value()) {
             msg.channel.send(`${msg.author.toString()} No such reaction available!`);