fix for updating tag

This commit is contained in:
loicbersier 2019-08-11 19:31:51 +02:00
parent 20f96b57ca
commit 26871e0922

View file

@ -45,8 +45,8 @@ class TagCommand extends Command {
const filter = m => m.content && m.author.id == message.author.id; const filter = m => m.content && m.author.id == message.author.id;
message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] })
.then(async messages => { .then(async messages => {
let messageContent = messages.map(messages => messages.content); let messageContent = messages.map(messages => messages.content.tolowerCase());
if (messageContent.tolowerCase() == 'y' || messageContent.tolowerCase() == 'yes') { if (messageContent == 'y' || messageContent == 'yes') {
const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id}; const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id};
await Tag.update(body, {where: {trigger: args.trigger, serverID: message.guild.id}}); await Tag.update(body, {where: {trigger: args.trigger, serverID: message.guild.id}});
return message.channel.send(`tag have been set to ${args.trigger} : ${args.response}`); return message.channel.send(`tag have been set to ${args.trigger} : ${args.response}`);