From f55e79e8f5a609702b91ff219e1ed70763b5f7ae Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 11 Jan 2019 23:04:13 +0100 Subject: [PATCH] Fixed autoresponse not working when no tag was set --- event/listeners/message.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 162ba71a..600c53e3 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -15,15 +15,9 @@ class messageListener extends Listener { async exec(message) { let autoresponse = reload('../../json/autoresponse.json'); let message_content = message.content.toLowerCase(); - let customresponse = reload(`../../tag/${message.guild.id}.json`); if (message.author.bot) return; { - // User autoresponse - if(customresponse[message_content]) { - message.channel.send(customresponse[message_content]); - } - // If autoresponse is enable send the response if(autoresponse[message.channel.id] == 'enable') { // Reply with images as attachement @@ -44,6 +38,11 @@ class messageListener extends Listener { } else if (message_content.includes('jeff')) { message.react('496028845967802378'); } + } + // User autoresponse + let customresponse = reload(`../../tag/${message.guild.id}.json`); + if(customresponse[message_content]) { + message.channel.send(customresponse[message_content]); } } }