From c9cdb473386ba4f049852b5add65fb3d1d6b4173 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 30 May 2021 11:24:23 -0400 Subject: [PATCH] Add __repr__ for View --- discord/ui/view.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/ui/view.py b/discord/ui/view.py index a88828241..81379b329 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