Add support for components V2

Co-authored-by: Michael H <michael@michaelhall.tech>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Co-authored-by: owocado <24418520+owocado@users.noreply.github.com>
Co-authored-by: Jay3332 <40323796+jay3332@users.noreply.github.com>
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
DA344
2025-08-14 02:37:23 +02:00
committed by GitHub
parent 6ec2e5329b
commit 50caa3c82c
33 changed files with 4214 additions and 298 deletions

View File

@ -81,6 +81,8 @@ __all__ = (
'StatusDisplayType',
'OnboardingPromptType',
'OnboardingMode',
'SeparatorSpacing',
'MediaItemLoadingState',
)
@ -668,6 +670,13 @@ class ComponentType(Enum):
role_select = 6
mentionable_select = 7
channel_select = 8
section = 9
text_display = 10
thumbnail = 11
media_gallery = 12
file = 13
separator = 14
container = 17
def __int__(self) -> int:
return self.value
@ -953,6 +962,18 @@ class OnboardingMode(Enum):
advanced = 1
class SeparatorSpacing(Enum):
small = 1
large = 2
class MediaItemLoadingState(Enum):
unknown = 0
loading = 1
loaded = 2
not_found = 3
def create_unknown_value(cls: Type[E], val: Any) -> E:
value_cls = cls._enum_value_cls_ # type: ignore # This is narrowed below
name = f'unknown_{val}'