Don't store finished views/modals

This commit is contained in:
z03h
2023-02-13 20:52:40 -08:00
committed by GitHub
parent caf0fbdc1b
commit e6ef43139f
4 changed files with 9 additions and 6 deletions

View File

@ -784,7 +784,7 @@ class InteractionResponse(Generic[ClientT]):
params=params,
)
if view is not MISSING:
if view is not MISSING and not view.is_finished():
if ephemeral and view.timeout is None:
view.timeout = 15 * 60.0
@ -954,8 +954,8 @@ class InteractionResponse(Generic[ClientT]):
proxy_auth=http.proxy_auth,
params=params,
)
self._parent._state.store_view(modal)
if not modal.is_finished():
self._parent._state.store_view(modal)
self._response_type = InteractionResponseType.modal
async def autocomplete(self, choices: Sequence[Choice[ChoiceT]]) -> None: