K
Docs
API Reference→Pieces→Grey Out the Buttons
🚫

Grey Out the Buttons

ui.disableThe Control PanelControls

Leaves every button and dropdown on the message visible but dead. The one-line fix for people clicking twice, or voting after the poll closed.

When to use this
  • →Greying out keeps the buttons on screen so people can see what was offered
  • →Use Remove the Buttons instead to take them away entirely

On the canvas

This is what Grey Out the Buttons looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🚫
Grey Out the Buttons
ui.disable
Controls
output
error

Output ports

outputButtons greyed out
errorThat message had no buttons
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const rows = interaction.message.components.map((row) => ({
  ...row.toJSON(),
  components: row.components.map((c) => ({ ...c.toJSON(), disabled: true })),
}));
await interaction.update({ components: rows });