You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: discord/ui/core.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ class ItemInterface:
79
79
timeout: Optional[:class:`float`]
80
80
Timeout in seconds from last interaction with the UI before no longer accepting input. Defaults to 180.0.
81
81
If ``None`` then there is no timeout.
82
+
store: Optional[:class:`bool`]
83
+
Whether this interface should be stored for callback listening. Setting it to ``False`` will ignore callbacks and prevent item values from being refreshed. Defaults to ``True``.
82
84
83
85
Attributes
84
86
----------
@@ -87,8 +89,6 @@ class ItemInterface:
87
89
If ``None`` then there is no timeout.
88
90
children: List[:class:`Item`]
89
91
The list of children attached to this structure.
90
-
store: Optional[:class:`bool`]
91
-
Whether this interface should be stored for callback listening. Setting it to ``False`` will ignore callbacks and prevent item values from being refreshed. Defaults to ``True``.
Copy file name to clipboardExpand all lines: discord/ui/view.py
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -585,6 +585,8 @@ class View(BaseView):
585
585
timeout: Optional[:class:`float`]
586
586
Timeout in seconds from last interaction with the UI before no longer accepting input. Defaults to 180.0.
587
587
If ``None`` then there is no timeout.
588
+
disable_on_timeout: :class:`bool`
589
+
Whether to disable the view when the timeout is reached. Defaults to ``False``.
588
590
store: Optional[:class:`bool`]
589
591
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
590
592
@@ -595,8 +597,6 @@ class View(BaseView):
595
597
If ``None`` then there is no timeout.
596
598
children: List[:class:`ViewItem`]
597
599
The list of children attached to this view.
598
-
disable_on_timeout: :class:`bool`
599
-
Whether to disable the view when the timeout is reached. Defaults to ``False``.
600
600
message: Optional[:class:`.Message`]
601
601
The message that this view is attached to.
602
602
If ``None`` then the view has not been sent with a message.
@@ -688,6 +688,10 @@ def from_message(
688
688
The message with components to convert into a view.
689
689
timeout: Optional[:class:`float`]
690
690
The timeout of the converted view.
691
+
disable_on_timeout: :class:`bool`
692
+
Whether to disable the view when the timeout is reached. Defaults to ``False``.
693
+
store: Optional[:class:`bool`]
694
+
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
691
695
692
696
Returns
693
697
-------
@@ -707,6 +711,8 @@ def from_dict(
707
711
/,
708
712
*,
709
713
timeout: float|None=180.0,
714
+
disable_on_timeout: bool=False,
715
+
store: bool=True,
710
716
) ->View:
711
717
"""Converts a list of component dicts into a :class:`View`.
712
718
@@ -716,14 +722,18 @@ def from_dict(
716
722
The list of components to convert into a view.
717
723
timeout: Optional[:class:`float`]
718
724
The timeout of the converted view.
725
+
disable_on_timeout: :class:`bool`
726
+
Whether to disable the view when the timeout is reached. Defaults to ``False``.
727
+
store: Optional[:class:`bool`]
728
+
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
719
729
720
730
Returns
721
731
-------
722
732
:class:`View`
723
733
The converted view. This always returns a :class:`View` and not
Timeout in seconds from last interaction with the UI before no longer accepting input. Defaults to 180.0.
832
842
If ``None`` then there is no timeout.
843
+
disable_on_timeout: :class:`bool`
844
+
Whether to disable the view's items when the timeout is reached. Defaults to ``False``.
833
845
store: Optional[:class:`bool`]
834
846
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
835
847
@@ -840,8 +852,6 @@ class DesignerView(BaseView):
840
852
If ``None`` then there is no timeout.
841
853
children: List[:class:`ViewItem`]
842
854
The list of items attached to this view.
843
-
disable_on_timeout: :class:`bool`
844
-
Whether to disable the view's items when the timeout is reached. Defaults to ``False``.
845
855
message: Optional[:class:`.Message`]
846
856
The message that this view is attached to.
847
857
If ``None`` then the view has not been sent with a message.
@@ -902,6 +912,10 @@ def from_message(
902
912
The message with components to convert into a view.
903
913
timeout: Optional[:class:`float`]
904
914
The timeout of the converted view.
915
+
disable_on_timeout: :class:`bool`
916
+
Whether to disable the view when the timeout is reached. Defaults to ``False``.
917
+
store: Optional[:class:`bool`]
918
+
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
905
919
906
920
Returns
907
921
-------
@@ -923,6 +937,8 @@ def from_dict(
923
937
/,
924
938
*,
925
939
timeout: float|None=180.0,
940
+
disable_on_timeout: bool=False,
941
+
store: bool=True,
926
942
) ->DesignerView:
927
943
"""Converts a list of component dicts into a :class:`DesignerView`.
928
944
@@ -932,14 +948,18 @@ def from_dict(
932
948
The list of components to convert into a view.
933
949
timeout: Optional[:class:`float`]
934
950
The timeout of the converted view.
951
+
disable_on_timeout: :class:`bool`
952
+
Whether to disable the view when the timeout is reached. Defaults to ``False``.
953
+
store: Optional[:class:`bool`]
954
+
Whether this view should be stored for callback listening. Setting it to ``False`` will ignore item callbacks and prevent their values from being refreshed. Defaults to ``True``.
935
955
936
956
Returns
937
957
-------
938
958
:class:`DesignerView`
939
959
The converted view. This always returns a :class:`DesignerView` and not
0 commit comments