From f1f774736dd7b47b0938f1e2c4f9b159ebfb81c8 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Thu, 20 Sep 2018 14:09:55 +0200 Subject: [PATCH] Fixed reaction --- index.js | 17 ++++++++++------- react.json | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 0acf5bca..5d44556b 100644 --- a/index.js +++ b/index.js @@ -66,14 +66,17 @@ client.registry // Auto respond to messages client.on("message", async (message) => { let message_content = message.content.toLowerCase(); - if(responseObject[message_content]) { - message.channel.send(responseObject[message_content]); - }; - - if(reactObject[message_content]) { - message.react(reactObject[message_content]); + if(responseObject[message_content] && reactObject[message_content]) { + message.channel.send(responseObject[message_content]); + message.react(reactObject[message_content]); + } + else if(reactObject[message_content]) { + message.react(reactObject[message_content]); } - }); + else if(responseObject[message_content]) { + message.channel.send(responseObject[message_content]); + } + }); client.on('error', console.error); diff --git a/react.json b/react.json index 08cf4fa2..4aadb77d 100644 --- a/react.json +++ b/react.json @@ -1,3 +1,4 @@ { - "like if owned": "👍" + "like if owned": "👍", + "fortnite": "🤦" } \ No newline at end of file