Procházet zdrojové kódy

Add authorisation check for reactions

denikson před 6 roky
rodič
revize
acc6208a03
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  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!`);