From a7f549dcd9a3c8d8dcbe03f85d382064c52de5ad Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 20 Nov 2019 18:15:24 +0100 Subject: [PATCH] Make --remove work withtout having to provide the response args --- commands/admin/tag.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/commands/admin/tag.js b/commands/admin/tag.js index fd6465d2..513681e0 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -16,18 +16,15 @@ class TagCommand extends Command { start: 'What word or sentence should trigger it?', } }, - { - id: 'response', - type: 'string', - match: 'rest', - prompt: { - start: 'What word or sentence should the response be?', - } - }, { id: 'remove', match: 'flag', flag: '--remove' + }, + { + id: 'response', + type: 'string', + match: 'rest', } ], channelRestriction: 'guild', @@ -55,6 +52,10 @@ class TagCommand extends Command { } } + if (!args.response) { + return message.channel.send('Please provide the response for that tag'); + } + if (!tag) { const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id}; await Tag.create(body);