Don't store finished views/modals

This commit is contained in:
z03h authored and GitHub committed 2023-02-13 23:52:40 -05:00
1 parent caf0fbdc1b
commit e6ef43139f
4 files changed
+9 -6

No files matched your search

+4 -1
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