Skip to content

Commit

Permalink
refactor(components): default set boolean methods to true (#7502)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImRodry authored Feb 20, 2022
1 parent 71f4fa8 commit b122149
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
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
2 changes: 1 addition & 1 deletion packages/builders/src/components/selectMenu/SelectMenu.ts
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

0 comments on commit b122149

Please sign in to comment.