Skip to content

Commit

Permalink
fix: return a cancel flag if the user cancels a prompt in separate ma…
Browse files Browse the repository at this point in the history
…tch (#139)
  • Loading branch information
Norviah committed Jul 14, 2020
1 parent 0f5b240 commit 8f8281d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/struct/commands/arguments/ArgumentRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ class ArgumentRunner {

const res = [];
for (const phrase of phrases) {
res.push(await arg.process(message, phrase.value));
const response = await arg.process(message, phrase.value);

if (Flag.is(response, 'cancel')) {
return response;
}

res.push(response);
}

if (arg.index != null) {
Expand Down

0 comments on commit 8f8281d

Please sign in to comment.