Skip to content

Commit b1b7822

Browse files
authored
fix(Command): use optional access operator (#307)
1 parent 4a5d4c1 commit b1b7822

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/structures/Command.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ export abstract class Command<T = Args, O extends CommandOptions = CommandOption
237237
// be set. If an overridden value is passed, it will have priority. Otherwise it will default to 0 if filtered
238238
// (causing the precondition to not be registered) or the default value with a fallback to a single-use cooldown.
239239
const filtered = defaultCooldown?.filteredCommands?.includes(this.name) ?? false;
240-
const limit = options.cooldownLimit ?? (filtered ? 0 : defaultCooldown!.limit ?? 1);
241-
const delay = options.cooldownDelay ?? (filtered ? 0 : defaultCooldown!.delay ?? 0);
240+
const limit = options.cooldownLimit ?? (filtered ? 0 : defaultCooldown?.limit ?? 1);
241+
const delay = options.cooldownDelay ?? (filtered ? 0 : defaultCooldown?.delay ?? 0);
242242

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

0 commit comments

Comments
 (0)