update_component
Coroutinemust be awaited
Reloads the message, then updates every matching component.
from discord_interactions import update_componentSignature
async def update_component( message: Any, selector: str | Callable[[Dict[str, Any]], bool], updates: Dict[str, Any],) -> boolParameters
| Name | Type | Default | Description |
|---|---|---|---|
message | Any | required | Message holding the component. |
selector | str | Callable[[Dict[str, Any]], bool] | required | Exact custom_id or a (component) -> bool function. |
updates | Dict[str, Any] | required | Fields to replace, for example {"disabled": True}. |
Returns
bool True when at least one component changed.
Example
from discord_interactions import defer_interaction, update_component await defer_interaction(interaction, update=True)await update_component(interaction.message, "valider", {"disabled": True, "label": "Validé"})