Skip to content

Commit

Permalink
fix: return only boolean for disabled (#8965)
Browse files Browse the repository at this point in the history
* fix: return only boolean for `disabled`

* fix: return only boolean for `disabled`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
MrMythicalYT and kodiakhq[bot] committed Dec 24, 2022
1 parent 153352a commit 6614603
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/structures/BaseSelectMenuComponent.js
Expand Up @@ -45,11 +45,11 @@ class BaseSelectMenuComponent extends Component {

/**
* Whether this select menu is disabled
* @type {?boolean}
* @type {boolean}
* @readonly
*/
get disabled() {
return this.data.disabled ?? null;
return this.data.disabled ?? false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/structures/ButtonComponent.js
Expand Up @@ -36,11 +36,11 @@ class ButtonComponent extends Component {

/**
* Whether this button is disabled
* @type {?boolean}
* @type {boolean}
* @readonly
*/
get disabled() {
return this.data.disabled ?? null;
return this.data.disabled ?? false;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/typings/index.d.ts
Expand Up @@ -678,7 +678,7 @@ export class ButtonComponent extends Component<APIButtonComponent> {
public get style(): ButtonStyle;
public get label(): string | null;
public get emoji(): APIMessageComponentEmoji | null;
public get disabled(): boolean | null;
public get disabled(): boolean;
public get customId(): string | null;
public get url(): string | null;
}
Expand Down Expand Up @@ -759,7 +759,7 @@ export class BaseSelectMenuComponent<Data extends APISelectMenuComponent> extend
public get maxValues(): number | null;
public get minValues(): number | null;
public get customId(): string;
public get disabled(): boolean | null;
public get disabled(): boolean;
}

export class StringSelectMenuComponent extends BaseSelectMenuComponent<APIStringSelectComponent> {
Expand Down

0 comments on commit 6614603

Please sign in to comment.