mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-27 21:45:27 +00:00
Add second generic parameter for view for DynamicItem
This commit is contained in:
parent
ab6efd02bc
commit
fe7ce982f3
@ -39,11 +39,14 @@ if TYPE_CHECKING:
|
||||
from ..components import Component
|
||||
from ..enums import ComponentType
|
||||
from .view import View, LayoutView
|
||||
|
||||
V = TypeVar('V', bound=Union[View, LayoutView], covariant=True, default=Union[View, LayoutView])
|
||||
else:
|
||||
View = LayoutView = Any
|
||||
from .item import V
|
||||
|
||||
|
||||
class DynamicItem(Generic[BaseT], Item[Union[View, LayoutView]]):
|
||||
class DynamicItem(Generic[BaseT, V], Item[V]):
|
||||
"""Represents an item with a dynamic ``custom_id`` that can be used to store state within
|
||||
that ``custom_id``.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user