mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
refactor(components): default set boolean methods to true (#7502)
This commit is contained in:
@@ -30,7 +30,7 @@ export class ButtonComponent extends UnsafeButtonComponent {
|
|||||||
return super.setEmoji(emojiValidator.parse(emoji));
|
return super.setEmoji(emojiValidator.parse(emoji));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override setDisabled(disabled: boolean) {
|
public override setDisabled(disabled = true) {
|
||||||
return super.setDisabled(disabledValidator.parse(disabled));
|
return super.setDisabled(disabledValidator.parse(disabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class UnsafeButtonComponent extends Component<Partial<APIButtonComponent>
|
|||||||
* Sets whether this button is disable or not
|
* Sets whether this button is disable or not
|
||||||
* @param disabled Whether or not to disable this button 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;
|
this.data.disabled = disabled;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class SelectMenuComponent extends UnsafeSelectMenuComponent {
|
|||||||
return super.setCustomId(customIdValidator.parse(customId));
|
return super.setCustomId(customIdValidator.parse(customId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override setDisabled(disabled: boolean) {
|
public override setDisabled(disabled = true) {
|
||||||
return super.setDisabled(disabledValidator.parse(disabled));
|
return super.setDisabled(disabledValidator.parse(disabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class SelectMenuOption extends UnsafeSelectMenuOption {
|
|||||||
return super.setDescription(labelValueValidator.parse(description));
|
return super.setDescription(labelValueValidator.parse(description));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override setDefault(isDefault: boolean) {
|
public override setDefault(isDefault = true) {
|
||||||
return super.setDefault(defaultValidator.parse(isDefault));
|
return super.setDefault(defaultValidator.parse(isDefault));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export class UnsafeSelectMenuComponent extends Component<
|
|||||||
* Sets whether or not this select menu is disabled
|
* Sets whether or not this select menu is disabled
|
||||||
* @param disabled 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;
|
this.data.disabled = disabled;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export class UnsafeSelectMenuOption {
|
|||||||
* Sets whether this option is selected by default
|
* Sets whether this option is selected by default
|
||||||
* @param isDefault 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;
|
this.data.default = isDefault;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user