K
Kord2mo ago
Lynx1

Components do not work when working with webhooks

Hello, guys. I'm having an issue with components when working with webhooks. Am I doing something wrong? Doesn't work:
val webhook = kord.getWebhookWithTokenOrNull(Snowflake(webhookId), webhookToken)
webhook?.execute(webhookToken) {
content = "<@&$projectTeamRoleId> Application for media partnership from ${user.mention}"
embeds = mutableListOf(
EmbedBuilder().apply {
description = """
- **Candidate:** ${user.mention}
- **Name:** $name
- **Age:** $age
...
""".trimIndent()
}
)
components = mutableListOf(
ActionRowBuilder().apply {
interactionButton(ButtonStyle.Success, "$APPROVE_BUTTON_ID:${user.id}") {
label = "Approve"
}
interactionButton(ButtonStyle.Danger, "$REJECT_BUTTON_ID:${user.id}") {
label = "Reject"
}
}
)
}
val webhook = kord.getWebhookWithTokenOrNull(Snowflake(webhookId), webhookToken)
webhook?.execute(webhookToken) {
content = "<@&$projectTeamRoleId> Application for media partnership from ${user.mention}"
embeds = mutableListOf(
EmbedBuilder().apply {
description = """
- **Candidate:** ${user.mention}
- **Name:** $name
- **Age:** $age
...
""".trimIndent()
}
)
components = mutableListOf(
ActionRowBuilder().apply {
interactionButton(ButtonStyle.Success, "$APPROVE_BUTTON_ID:${user.id}") {
label = "Approve"
}
interactionButton(ButtonStyle.Danger, "$REJECT_BUTTON_ID:${user.id}") {
label = "Reject"
}
}
)
}
Works:
kord.rest.channel.createMessage(Snowflake("<channel id>")) {
content = "<@&$projectTeamRoleId> Application for media partnership from ${user.mention}"
embeds = mutableListOf(
EmbedBuilder().apply {
description = """
- **Candidate:** ${user.mention}
- **Name:** $name
- **Age:** $age
...
""".trimIndent()
}
)
components = mutableListOf(
ActionRowBuilder().apply {
interactionButton(ButtonStyle.Success, "$APPROVE_BUTTON_ID:${user.id}") {
label = "Approve"
}
interactionButton(ButtonStyle.Danger, "$REJECT_BUTTON_ID:${user.id}") {
label = "Reject"
}
}
)
}
kord.rest.channel.createMessage(Snowflake("<channel id>")) {
content = "<@&$projectTeamRoleId> Application for media partnership from ${user.mention}"
embeds = mutableListOf(
EmbedBuilder().apply {
description = """
- **Candidate:** ${user.mention}
- **Name:** $name
- **Age:** $age
...
""".trimIndent()
}
)
components = mutableListOf(
ActionRowBuilder().apply {
interactionButton(ButtonStyle.Success, "$APPROVE_BUTTON_ID:${user.id}") {
label = "Approve"
}
interactionButton(ButtonStyle.Danger, "$REJECT_BUTTON_ID:${user.id}") {
label = "Reject"
}
}
)
}
There were no exceptions in console. Kord version: 0.15.0
No description
Solution:
non-application-owned webhooks can't have interactive components: https://discord.com/developers/docs/resources/webhook#execute-webhook
Discord Developer Portal
Discord for Developers
Build games, experiences, and integrations for millions of users on Discord.
Jump to solution
1 Reply
Solution
LustigerLurch
LustigerLurch2mo ago
non-application-owned webhooks can't have interactive components: https://discord.com/developers/docs/resources/webhook#execute-webhook
Discord Developer Portal
Discord for Developers
Build games, experiences, and integrations for millions of users on Discord.

Did you find this page helpful?