mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +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):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user