Skip to content

Commit

Permalink
feat: builder label, title overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfun committed Jan 18, 2025
1 parent 7f54696 commit 23df341
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/builders/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ export class Button<T extends ButtonStyle = 'Primary'> extends Builder<APIButton
* @returns {this}
*/
disabled = (e = true) => this.a({ disabled: e })
/**
* Overwrite label
*
* available: Primary, Secondary, Success, Danger, Link
* @param {string} e
* @returns {this}
*/
label = (e: T extends 'SKU' ? undefined : string) => this.#assign('emoji', ['SKU'], { label: e })
}

type SelectType = 'String' | 'User' | 'Role' | 'Mentionable' | 'Channel'
Expand Down
9 changes: 9 additions & 0 deletions src/builders/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ export class Modal {
})
return this
}
/**
* Overwrite title
* @param {string} e
* @returns {this}
*/
title = (e: string) => {
this.#data.title = e
return this
}
}

export class TextInput extends Builder<APITextInputComponent> {
Expand Down

0 comments on commit 23df341

Please sign in to comment.