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

@ -2694,7 +2694,7 @@ class Client:
TypeError
A view was not passed.
ValueError
The view is not persistent. A persistent view has no timeout
The view is not persistent or is already finished. A persistent view has no timeout
and all their components have an explicitly provided custom_id.
"""
@ -2704,6 +2704,9 @@ class Client:
if not view.is_persistent():
raise ValueError('View is not persistent. Items need to have a custom_id set and View must have no timeout')
if view.is_finished():
raise ValueError('View is already finished.')
self._connection.store_view(view, message_id)
@property