diff options
| author | Rapptz <[email protected]> | 2021-05-30 11:24:23 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-05-30 11:24:23 -0400 |
| commit | c9cdb473386ba4f049852b5add65fb3d1d6b4173 (patch) | |
| tree | eeed1356e752e592088fcad3c2cfc6be28c1227c | |
| parent | Allow Webhook.send to send ephemeral messages (diff) | |
| download | discord.py-c9cdb473386ba4f049852b5add65fb3d1d6b4173.tar.xz discord.py-c9cdb473386ba4f049852b5add65fb3d1d6b4173.zip | |
Add __repr__ for View
| -rw-r--r-- | discord/ui/view.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/ui/view.py b/discord/ui/view.py index a8882824..81379b32 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -160,6 +160,9 @@ class View: self._timeout_handler: Optional[asyncio.TimerHandle] = None self._stopped = loop.create_future() + def __repr__(self) -> str: + return f'<{self.__class__.__name__} timeout={self.timeout} children={len(self.children)}>' + def to_components(self) -> List[Dict[str, Any]]: def key(item: Item) -> int: return item._rendered_row or 0 |