Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sapphiredev/framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.1
Choose a base ref
...
head repository: sapphiredev/framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.2
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Oct 17, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b1b7822 View commit details
  2. chore(release): 2.1.2

    favna committed Oct 17, 2021

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    5c51f3d View commit details
Showing with 9 additions and 3 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +2 −2 src/lib/structures/Command.ts
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.1.2](https://github.com/sapphiredev/framework/compare/v2.1.1...v2.1.2) (2021-10-17)

### Bug Fixes

- **Command:** use optional access operator ([#307](https://github.com/sapphiredev/framework/issues/307)) ([b1b7822](https://github.com/sapphiredev/framework/commit/b1b7822505f0dbb83d067ec86919ed3d23931d4d))

### [2.1.1](https://github.com/sapphiredev/framework/compare/v2.1.0...v2.1.1) (2021-10-17)

### Bug Fixes
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sapphire/framework",
"version": "2.1.1",
"version": "2.1.2",
"description": "Discord bot framework built on top of @sapphire/lib for advanced and amazing bots.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
4 changes: 2 additions & 2 deletions src/lib/structures/Command.ts
Original file line number Diff line number Diff line change
@@ -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;