discord/discord-api-docs

Labels in modal submissions are missing their text and description

Closed this issue · 2 comments

Description

As the title says, labels containing either text inputs or select menus will have their label text and description missing when a modal response is submitted to the application. This seems unintended, especially because the label field is marked non-optional in the docs.

Steps to Reproduce

Create a modal interaction with a label inside it, with the label text and description set:

"components": [
  {
    "type": 18,
    "label": "Name",
    "description": "Enter your name.",
    "component": {
      "type": 4,
      "custom_id": "0",
      "style": 1,
      "min_length": null,
      "max_length": null,
      "required": true
    }
  },
]

Then, fill in the text input and submit a modal response.

Expected Behavior

The payload delivered to the application contains the label text and description:

{
  "type": 18,
  "id": 1,
  "label": "Name",
  "description": "Enter your name",
  "component": {
    "value": "John Doe",
    "type": 4,
    "id": 5,
    "custom_id": "0"
  }
}

Current Behavior

The label text and description are missing:

{
  "type": 18,
  "id": 1,
  "component": {
    "value": "John Doe",
    "type": 4,
    "id": 5,
    "custom_id": "0"
  }
}

Screenshots/Videos

No response

Client and System Information

Using API v10

Labels and descriptions are documented as not present on interaction callbacks. https://discord.com/developers/docs/components/reference#label-label-interaction-response-structure

My apologies, I hadn't spotted those docs.