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

refactor(components): default set boolean methods to true #7502

Merged
merged 1 commit into from
Feb 20, 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
2 changes: 1 addition & 1 deletion packages/builders/src/components/button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ButtonComponent extends UnsafeButtonComponent {
return super.setEmoji(emojiValidator.parse(emoji));
}

public override setDisabled(disabled: boolean) {
public override setDisabled(disabled = true) {
return super.setDisabled(disabledValidator.parse(disabled));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/builders/src/components/button/UnsafeButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class UnsafeButtonComponent extends Component<Partial<APIButtonComponent>
* Sets whether this button is disable or not
* @param disabled Whether or not to disable this button or not
*/
public setDisabled(disabled: boolean) {
public setDisabled(disabled = true) {
this.data.disabled = disabled;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SelectMenuComponent extends UnsafeSelectMenuComponent {
return super.setCustomId(customIdValidator.parse(customId));
}

public override setDisabled(disabled: boolean) {
public override setDisabled(disabled = true) {
return super.setDisabled(disabledValidator.parse(disabled));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class SelectMenuOption extends UnsafeSelectMenuOption {
return super.setDescription(labelValueValidator.parse(description));
}

public override setDefault(isDefault: boolean) {
public override setDefault(isDefault = true) {
return super.setDefault(defaultValidator.parse(isDefault));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class UnsafeSelectMenuComponent extends Component<
* Sets whether or not this select menu is disabled
* @param disabled Whether or not this select menu is disabled
*/
public setDisabled(disabled: boolean) {
public setDisabled(disabled = true) {
this.data.disabled = disabled;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class UnsafeSelectMenuOption {
* Sets whether this option is selected by default
* @param isDefault Whether this option is selected by default
*/
public setDefault(isDefault: boolean) {
public setDefault(isDefault = true) {
this.data.default = isDefault;
return this;
}
Expand Down