Fixed autoresponse not working when no tag was set

This commit is contained in:
loicbersier 2019-01-11 23:04:13 +01:00
parent d820bc6adf
commit f55e79e8f5

View file

@ -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]);
}
}
}