Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Commit

Permalink
Emit commandCancel when reason is promptLimit or prompt length is z…
Browse files Browse the repository at this point in the history
…ero (#379)

* Emit `commandCancel` when reason is promptLimit or prompt length is zero

* Fix space after if
  • Loading branch information
nearbyplayer committed Mar 27, 2021
1 parent 6b9e4ee commit 02be96b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/extensions/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ module.exports = Structures.extend('Message', Message => {
collResult = await this.command.argsCollector.obtain(this, provided);
if(collResult.cancelled) {
if(collResult.prompts.length === 0 || collResult.cancelled === 'promptLimit') {
this.client.emit('commandCancel', this.command, collResult.cancelled, this, collResult);
const err = new CommandFormatError(this);
return this.reply(err.message);
}
Expand Down

0 comments on commit 02be96b

Please sign in to comment.