소스 검색

Add logs for reactions; reduce raction chance

ghorsington 5 년 전
부모
커밋
39f2a34a78
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      main.js

+ 4 - 2
main.js

@@ -4,7 +4,7 @@ const path = require("path");
 const client = require("./client.js");
 const util = require("./util.js");
 
-const REACT_PROBABILITY = 0.4;
+const REACT_PROBABILITY = 0.3;
 
 function trigger(actions, ...params) {
     let actionDone = false;
@@ -81,8 +81,10 @@ client.on("message", m => {
 });
 
 client.on("messageReactionAdd", (r, u) => {
-    if (Math.random() <= REACT_PROBABILITY && !r.me)
+    if (Math.random() <= REACT_PROBABILITY && !r.me) {
+        console.log(`Reacting to message ${r.message.id} because user ${u.tag} reacted to it`);
         r.message.react(r.emoji);
+    }
 });
 
 function main() {