Skip to content

Commit 37c83bd

Browse files
committed
fix: optional chaining
1 parent b9f1e32 commit 37c83bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/structures/arguments/Boolean.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export class BooleanType extends MessageArgumentTypeBase {
88
value;
99

1010
validate(content: string): boolean {
11-
const yes = truthy.has(content.toLowerCase());
12-
const no = falsy.has(content.toLowerCase());
11+
const yes = truthy.has(content?.toLowerCase());
12+
const no = falsy.has(content?.toLowerCase());
1313

1414
if (!yes && !no) return false;
1515
else {

src/lib/structures/arguments/User.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class UserType extends MessageArgumentTypeBase {
66
matches;
77

88
validate(content: string): boolean {
9-
const matches = content.match(/([0-9]+)/);
9+
const matches = content?.match(/([0-9]+)/);
1010

1111
if (!matches) return false;
1212

0 commit comments

Comments
 (0)