Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return only boolean for disabled #8965

Merged
merged 3 commits into from
Dec 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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