Skip to content

Commit

Permalink
fix: OptionsHandler#getInteger was not typed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilloftheshadow committed Sep 3, 2024
1 parent 8665c17 commit 2bdc7f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/kind-ears-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@buape/carbon": patch
---

fix: OptionsHandler#getInteger was not typed correctly
3 changes: 2 additions & 1 deletion packages/carbon/src/internals/OptionsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export class OptionsHandler extends Base {
const num = this.raw.find(
(x) => x.name === key && x.type === ApplicationCommandOptionType.Integer
)?.value
if (!num || !Number.isSafeInteger(num)) return undefined
if (!num || typeof num !== "number" || !Number.isSafeInteger(num))
return undefined
return num
}

Expand Down

0 comments on commit 2bdc7f3

Please sign in to comment.