From 07ceb10ed6398dc322ebd00f203821a87507f64c Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 17 Jul 2019 01:17:03 +0200 Subject: [PATCH] use await --- commands/admin/tag.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/admin/tag.js b/commands/admin/tag.js index 70254e2d..73e46254 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -38,17 +38,17 @@ class TagCommand extends Command { if (!tag) { const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id}; - Tag.create(body); + await Tag.create(body); return message.channel.send(`tag have been set to ${args.trigger} : ${args.response}`); } else { message.channel.send('This tag already exist, do you want to update it? y/n'); const filter = m => m.content && m.author.id == message.author.id; message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) - .then(messages => { + .then(async messages => { let messageContent = messages.map(messages => messages.content); if (messageContent == 'y' || messageContent == 'yes') { const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id}; - 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}`); } })