From c22f058fa0ea616152d4f00494150624f60625a6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 17 Feb 2022 07:35:12 -0500 Subject: [PATCH] Fix views not being removed upon timeout --- discord/ui/view.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discord/ui/view.py b/discord/ui/view.py index 13510eeaf..27aa54f42 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -376,6 +376,10 @@ class View: if self.__stopped.done(): return + if self.__cancel_callback: + self.__cancel_callback(self) + self.__cancel_callback = None + self.__stopped.set_result(True) asyncio.create_task(self.on_timeout(), name=f'discord-ui-view-timeout-{self.id}')