Skip to content

Commit

Permalink
fix(Command): use optional access operator (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Oct 17, 2021
1 parent 4a5d4c1 commit b1b7822
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/structures/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ export abstract class Command<T = Args, O extends CommandOptions = CommandOption
// be set. If an overridden value is passed, it will have priority. Otherwise it will default to 0 if filtered
// (causing the precondition to not be registered) or the default value with a fallback to a single-use cooldown.
const filtered = defaultCooldown?.filteredCommands?.includes(this.name) ?? false;
const limit = options.cooldownLimit ?? (filtered ? 0 : defaultCooldown!.limit ?? 1);
const delay = options.cooldownDelay ?? (filtered ? 0 : defaultCooldown!.delay ?? 0);
const limit = options.cooldownLimit ?? (filtered ? 0 : defaultCooldown?.limit ?? 1);
const delay = options.cooldownDelay ?? (filtered ? 0 : defaultCooldown?.delay ?? 0);

if (limit && delay) {
const scope = options.cooldownScope ?? defaultCooldown?.scope ?? BucketScope.User;
Expand Down

0 comments on commit b1b7822

Please sign in to comment.