mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Add support for dynamic items that parse custom_id for state
This commit is contained in:
@ -32,6 +32,7 @@ from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
TYPE_CHECKING,
|
||||
Type,
|
||||
Union,
|
||||
Callable,
|
||||
Any,
|
||||
@ -84,6 +85,8 @@ if TYPE_CHECKING:
|
||||
from .http import HTTPClient
|
||||
from .voice_client import VoiceProtocol
|
||||
from .gateway import DiscordWebSocket
|
||||
from .ui.item import Item
|
||||
from .ui.dynamic import DynamicItem
|
||||
from .app_commands import CommandTree, Translator
|
||||
|
||||
from .types.automod import AutoModerationRule, AutoModerationActionExecution
|
||||
@ -395,6 +398,9 @@ class ConnectionState(Generic[ClientT]):
|
||||
def prevent_view_updates_for(self, message_id: int) -> Optional[View]:
|
||||
return self._view_store.remove_message_tracking(message_id)
|
||||
|
||||
def store_dynamic_items(self, *items: Type[DynamicItem[Item[Any]]]) -> None:
|
||||
self._view_store.add_dynamic_items(*items)
|
||||
|
||||
@property
|
||||
def persistent_views(self) -> Sequence[View]:
|
||||
return self._view_store.persistent_views
|
||||
|
Reference in New Issue
Block a user