1
0
Fork 0

Make --remove work withtout having to provide the response args

akairo
loicbersier 5 years ago
parent 11e50470cc
commit a7f549dcd9

@ -16,18 +16,15 @@ class TagCommand extends Command {
start: 'What word or sentence should trigger it?', 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', id: 'remove',
match: 'flag', match: 'flag',
flag: '--remove' flag: '--remove'
},
{
id: 'response',
type: 'string',
match: 'rest',
} }
], ],
channelRestriction: 'guild', 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) { if (!tag) {
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.create(body); await Tag.create(body);

Loading…
Cancel
Save