Fixed autoresponse not working when no tag was set
This commit is contained in:
parent
d820bc6adf
commit
f55e79e8f5
1 changed files with 5 additions and 6 deletions
|
@ -15,15 +15,9 @@ class messageListener extends Listener {
|
||||||
async exec(message) {
|
async exec(message) {
|
||||||
let autoresponse = reload('../../json/autoresponse.json');
|
let autoresponse = reload('../../json/autoresponse.json');
|
||||||
let message_content = message.content.toLowerCase();
|
let message_content = message.content.toLowerCase();
|
||||||
let customresponse = reload(`../../tag/${message.guild.id}.json`);
|
|
||||||
|
|
||||||
if (message.author.bot) return; {
|
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 is enable send the response
|
||||||
if(autoresponse[message.channel.id] == 'enable') {
|
if(autoresponse[message.channel.id] == 'enable') {
|
||||||
// Reply with images as attachement
|
// Reply with images as attachement
|
||||||
|
@ -44,6 +38,11 @@ class messageListener extends Listener {
|
||||||
} else if (message_content.includes('jeff')) {
|
} else if (message_content.includes('jeff')) {
|
||||||
message.react('496028845967802378');
|
message.react('496028845967802378');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// User autoresponse
|
||||||
|
let customresponse = reload(`../../tag/${message.guild.id}.json`);
|
||||||
|
if(customresponse[message_content]) {
|
||||||
|
message.channel.send(customresponse[message_content]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue