From 0c0edcfabab8e27eadff0f86cdaee181b7daf46b Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Wed, 28 Nov 2018 05:34:38 +0100 Subject: [PATCH] autoresponse disable by default --- index.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 3a2452d6..b9f7ee5e 100644 --- a/index.js +++ b/index.js @@ -81,34 +81,29 @@ client.registry // Reply with images as attachement if(imgResponseObject[message_content]) { var autoresponse = new SelfReloadJSON('./json/autoresponse.json'); - if(autoresponse[message.channel.id] == 'disable') - return console.log('disable') + if(autoresponse[message.channel.id] == 'enable') message.channel.send({files: [imgResponseObject[message_content]]}); } // React only to the messages else if(reactObject[message_content]) { var autoresponse = new SelfReloadJSON('./json/autoresponse.json'); - if(autoresponse[message.channel.id] == 'disable') - return console.log('disable') + if(autoresponse[message.channel.id] == 'enable') message.react(reactObject[message_content]); } // auto respond to messages else if(responseObject[message_content]) { var autoresponse = new SelfReloadJSON('./json/autoresponse.json'); - if(autoresponse[message.channel.id] == 'disable') - return console.log('disable') + if(autoresponse[message.channel.id] == 'enable') message.channel.send(responseObject[message_content]); // If it contain "like if" react with 👍 } else if (message_content.includes("like if")) { var autoresponse = new SelfReloadJSON('./json/autoresponse.json'); - if(autoresponse[message.channel.id] == 'disable') - return console.log('disable') + if(autoresponse[message.channel.id] == 'enable') message.react("\u{1F44D}") // If it contain "jeff" react with a jeff emote } else if (message_content.includes("jeff")) { var autoresponse = new SelfReloadJSON('./json/autoresponse.json'); - if(autoresponse[message.channel.id] == 'disable') - return console.log('disable') + if(autoresponse[message.channel.id] == 'enable') message.react("496028845967802378") } }});