K
Kord2d ago
marian

Modal stringSelect 400 error

I'm having issues adding a stringSelect component to my modal. Anyone has an idea what the problem is?
// event is MessageCommandInteractionCreateEvent
event.interaction.modal("Timeout", "123") {
actionRow {
stringSelect("time-unit") {
option("Minutes", "minutes")
}
}
}
// event is MessageCommandInteractionCreateEvent
event.interaction.modal("Timeout", "123") {
actionRow {
stringSelect("time-unit") {
option("Minutes", "minutes")
}
}
}
Getting error
REST request returned an error: 400 Invalid Form Body {"data":{"components":{"0":{"components":{"0":{"_errors":[{"code":"UNION_TYPE_CHOICES","message":"Value of field \"type\" must be one of (4,)."}]}}}}}}
REST request returned an error: 400 Invalid Form Body {"data":{"components":{"0":{"components":{"0":{"_errors":[{"code":"UNION_TYPE_CHOICES","message":"Value of field \"type\" must be one of (4,)."}]}}}}}}
Found an old issue saying that Modals don't support that: https://discord.com/channels/556525343595298817/1091796429175005265/1091796429175005265 But the API Docs say it is
String Selects are available in messages and modals. They must be placed inside an Action Row in messages and a Label in modals.
4 Replies
marian
marianOP2d ago
They must be placed inside an Action Row in messages and a Label in modals.
Hm i cant even find a way to labels
marian
marianOP2d ago
GitHub
GitHub - kordlib/kord at feat/components-v2
Idiomatic Kotlin Wrapper for The Discord API. Contribute to kordlib/kord development by creating an account on GitHub.
marian
marianOP2d ago
my bad!
NoComment
NoComment23h ago
all good bro, the branch is actually published on the maven, you could give it a test and provide some feedback, we're trying to get it merged :D

Did you find this page helpful?