mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-09 11:31:58 +00:00
Update View timeout only if interaction_check passes
This commit is contained in:
parent
5c7f6dd37e
commit
6327402730
@ -413,15 +413,15 @@ class View:
|
|||||||
|
|
||||||
async def _scheduled_task(self, item: Item, interaction: Interaction):
|
async def _scheduled_task(self, item: Item, interaction: Interaction):
|
||||||
try:
|
try:
|
||||||
if self.timeout:
|
|
||||||
self.__timeout_expiry = time.monotonic() + self.timeout
|
|
||||||
|
|
||||||
item._refresh_state(interaction.data) # type: ignore
|
item._refresh_state(interaction.data) # type: ignore
|
||||||
|
|
||||||
allow = await self.interaction_check(interaction)
|
allow = await self.interaction_check(interaction)
|
||||||
if not allow:
|
if not allow:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.timeout:
|
||||||
|
self.__timeout_expiry = time.monotonic() + self.timeout
|
||||||
|
|
||||||
await item.callback(interaction)
|
await item.callback(interaction)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return await self.on_error(interaction, e, item)
|
return await self.on_error(interaction, e, item)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user