Skip to content

Commit bef86c0

Browse files
committedAug 8, 2024·
fix: modals inputs allways required bug
1 parent aaca01d commit bef86c0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎src/getters.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ export const getModal = (id: string) => {
6262
const input = modal.config.inputs[id]
6363
const inputBuilder = new TextInputBuilder()
6464
.setCustomId(id)
65-
.setLabel(input.label)
65+
.setLabel(input.label ?? id)
6666
.setStyle(
6767
input.style ? TextInputStyle[input.style] : TextInputStyle.Short
6868
)
69+
.setRequired(input.required ?? true)
6970

7071
if (input.minLength) {
7172
inputBuilder.setMinLength(input.minLength)
@@ -79,9 +80,6 @@ export const getModal = (id: string) => {
7980
if (input.value) {
8081
inputBuilder.setValue(input.value)
8182
}
82-
if (input.required) {
83-
inputBuilder.setRequired(input.required)
84-
}
8583
builder.addComponents(useActionRow(inputBuilder))
8684
}
8785
}

0 commit comments

Comments
 (0)
Please sign in to comment.