row_update
Coroutineà attendre avec await
Transforme chaque composant d'une ou plusieurs rangées avec une fonction.
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]],) -> boolParamètres
| Nom | Type | Défaut | Description |
|---|---|---|---|
message | Any | requis | |
row_selector | str | int | Callable[[Dict[str, Any], int], bool] | requis | Index de rangée, custom_id d'un composant de la rangée, ou fonction (rangée, index) -> bool. |
updater | Callable[[Dict[str, Any]], Dict[str, Any] | None] | Callable[[Dict[str, Any]], Awaitable[Dict[str, Any] | None]] | requis | Fonction (synchrone ou async) qui renvoie le composant modifié, ou None pour le retirer. |
Retour
bool
Exemple
from discord_interactions import row_update def eteindre(bouton): bouton["style"] = 2 return bouton await row_update(interaction.message, 0, eteindre)