|
31 | 31 | import time
|
32 | 32 | from functools import partial
|
33 | 33 | from itertools import groupby
|
34 |
| -from typing import TYPE_CHECKING, Any, Callable, ClassVar, Iterator, Sequence, TypeVar |
| 34 | +from typing import TYPE_CHECKING, Any, ClassVar, Iterator, Sequence, TypeVar |
35 | 35 |
|
36 | 36 | from ..components import ActionRow as ActionRowComponent
|
37 | 37 | from ..components import Button as ButtonComponent
|
|
50 | 50 | from .core import ComponentUI
|
51 | 51 | from .item import Item, ItemCallbackType
|
52 | 52 |
|
53 |
| -__all__ = ("BaseView", "View", "DesignerView", "_component_to_item", "_walk_all_components") |
| 53 | +__all__ = ( |
| 54 | + "BaseView", |
| 55 | + "View", |
| 56 | + "DesignerView", |
| 57 | + "_component_to_item", |
| 58 | + "_walk_all_components", |
| 59 | +) |
54 | 60 |
|
55 | 61 |
|
56 | 62 | if TYPE_CHECKING:
|
@@ -191,6 +197,7 @@ def fits_legacy(self, item) -> bool:
|
191 | 197 | return item.row <= 4
|
192 | 198 | return self.weights[-1] + item.width <= 5
|
193 | 199 |
|
| 200 | + |
194 | 201 | class BaseView(ComponentUI):
|
195 | 202 | """The base class for UI views used in messages."""
|
196 | 203 |
|
@@ -501,6 +508,7 @@ def message(self):
|
501 | 508 | def message(self, value):
|
502 | 509 | self._message = value
|
503 | 510 |
|
| 511 | + |
504 | 512 | class View(BaseView):
|
505 | 513 | """Represents a UI view for v1 components :class:`~discord.ui.Button` and :class:`~discord.ui.Select`.
|
506 | 514 |
|
@@ -727,6 +735,7 @@ def refresh(self, components: list[Component]):
|
727 | 735 | def is_components_v2(self) -> bool:
|
728 | 736 | return False
|
729 | 737 |
|
| 738 | + |
730 | 739 | class DesignerView(BaseView):
|
731 | 740 | """Represents a UI view compatible with v2 components.
|
732 | 741 |
|
|
0 commit comments