mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(MessageComponents): default setDisabled to true (#6279)
This commit is contained in:
@@ -79,10 +79,10 @@ class MessageButton extends BaseMessageComponent {
|
||||
|
||||
/**
|
||||
* Sets the interactive status of the button
|
||||
* @param {boolean} disabled Whether this button should be disabled
|
||||
* @param {boolean} [disabled=true] Whether this button should be disabled
|
||||
* @returns {MessageButton}
|
||||
*/
|
||||
setDisabled(disabled) {
|
||||
setDisabled(disabled = true) {
|
||||
this.disabled = disabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ class MessageSelectMenu extends BaseMessageComponent {
|
||||
|
||||
/**
|
||||
* Sets the interactive status of the select menu
|
||||
* @param {boolean} disabled Whether this select menu should be disabled
|
||||
* @param {boolean} [disabled=true] Whether this select menu should be disabled
|
||||
* @returns {MessageSelectMenu}
|
||||
*/
|
||||
setDisabled(disabled) {
|
||||
setDisabled(disabled = true) {
|
||||
this.disabled = disabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
4
typings/index.d.ts
vendored
4
typings/index.d.ts
vendored
@@ -1165,7 +1165,7 @@ export class MessageButton extends BaseMessageComponent {
|
||||
public type: 'BUTTON';
|
||||
public url: string | null;
|
||||
public setCustomId(customId: string): this;
|
||||
public setDisabled(disabled: boolean): this;
|
||||
public setDisabled(disabled?: boolean): this;
|
||||
public setEmoji(emoji: EmojiIdentifierResolvable): this;
|
||||
public setLabel(label: string): this;
|
||||
public setStyle(style: MessageButtonStyleResolvable): this;
|
||||
@@ -1339,7 +1339,7 @@ export class MessageSelectMenu extends BaseMessageComponent {
|
||||
public type: 'SELECT_MENU';
|
||||
public addOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
|
||||
public setCustomId(customId: string): this;
|
||||
public setDisabled(disabled: boolean): this;
|
||||
public setDisabled(disabled?: boolean): this;
|
||||
public setMaxValues(maxValues: number): this;
|
||||
public setMinValues(minValues: number): this;
|
||||
public setPlaceholder(placeholder: string): this;
|
||||
|
||||
Reference in New Issue
Block a user