From 6327402730e70753b86fb57126d07102bf4b9582 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 18 Aug 2022 18:55:50 -0400 Subject: [PATCH] Update View timeout only if interaction_check passes --- discord/ui/view.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/ui/view.py b/discord/ui/view.py index 0f7087696..448a9e863 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -413,15 +413,15 @@ class View: async def _scheduled_task(self, item: Item, interaction: Interaction): try: - if self.timeout: - self.__timeout_expiry = time.monotonic() + self.timeout - item._refresh_state(interaction.data) # type: ignore allow = await self.interaction_check(interaction) if not allow: return + if self.timeout: + self.__timeout_expiry = time.monotonic() + self.timeout + await item.callback(interaction) except Exception as e: return await self.on_error(interaction, e, item)