row_update
Coroutinemust be awaited
Transforms every component of one or more rows with a function.
from discord_interactions import row_updateSignature
async def row_update( message: Any, row_selector: str | int | Callable[[Dict[str, Any], int], bool], updater: Callable[[Dict[str, Any]], Dict[str, Any] | None] | Callable[[Dict[str, Any]], Awaitable[Dict[str, Any] | None]],) -> boolParameters
| Name | Type | Default | Description |
|---|---|---|---|
message | Any | required | |
row_selector | str | int | Callable[[Dict[str, Any], int], bool] | required | Row index, custom_id of a component in the row, or a (row, index) -> bool function. |
updater | Callable[[Dict[str, Any]], Dict[str, Any] | None] | Callable[[Dict[str, Any]], Awaitable[Dict[str, Any] | None]] | required | Function (sync or async) returning the updated component, or None to remove it. |
Returns
bool
Example
from discord_interactions import row_update def eteindre(bouton): bouton["style"] = 2 return bouton await row_update(interaction.message, 0, eteindre)