From a80aa937258a50964881488fb46cecda742097fe Mon Sep 17 00:00:00 2001 From: Omkaar <79257339+Pysics@users.noreply.github.com> Date: Wed, 4 May 2022 09:39:12 +0530 Subject: [PATCH] Update view.py --- discord/ui/view.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/discord/ui/view.py b/discord/ui/view.py index 70e7c675dc..220da5102b 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -477,6 +477,19 @@ def disable_all_items(self, *, exclusions: Optional[List[Item]] = None) -> None: for child in self.children: if exclusions is None or child not in exclusions: child.disabled = True + + def enable_all_items(self, *, exclusions: Optional[List[Item]] = None) -> None: + """ + Enables all items in the view. + + Parameters + ----------- + exclusions: Optional[List[:class:`ui.Item`]] + A list of items in `self.children` to not enable from the view. + """ + for child in self.children: + if exclusions is None or child not in exclusions: + child.disabled = False class ViewStore: