This commit is contained in:
loicbersier 2019-07-23 21:26:41 +02:00
parent 0d947f80de
commit 71f7d3beb6

View file

@ -30,17 +30,17 @@ class autoresponseCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
if (args.stat == 'enable' || args.stat == 'disable') { if (args.stat.toLowerCase() == 'enable' || args.stat.toLowerCase() == 'disable') {
const autoresponseStat = await autoResponseStat.findOne({where: {serverID: message.guild.id}}); const autoresponseStat = await autoResponseStat.findOne({where: {serverID: message.guild.id}});
if (!autoresponseStat) { if (!autoresponseStat) {
const body = {serverID: message.guild.id, stat: args.stat}; const body = {serverID: message.guild.id, stat: args.stat};
autoResponseStat.create(body); autoResponseStat.create(body);
return message.channel.send(`Autoresponse have been ${args.stat}ed`); return message.channel.send(`Autoresponse have been ${args.stat}d`);
} else { } else {
const body = {serverID: message.guild.id, stat: args.stat}; const body = {serverID: message.guild.id, stat: args.stat};
autoResponseStat.update(body, {where: {serverID: message.guild.id}}); autoResponseStat.update(body, {where: {serverID: message.guild.id}});
return message.channel.send(`Autoresponse have been ${args.stat}ed`); return message.channel.send(`Autoresponse have been ${args.stat}d`);
} }
} }
} }