Add support for default_values field on selects

This commit is contained in:
Soheab_
2023-09-29 21:55:20 +02:00
committed by GitHub
parent 9f8f9bf56b
commit c5ecc42c72
6 changed files with 342 additions and 7 deletions

View File

@ -69,6 +69,7 @@ __all__ = (
'AutoModRuleActionType',
'ForumLayoutType',
'ForumOrderType',
'SelectDefaultValueType',
)
if TYPE_CHECKING:
@ -772,6 +773,12 @@ class ForumOrderType(Enum):
creation_date = 1
class SelectDefaultValueType(Enum):
user = 'user'
role = 'role'
channel = 'channel'
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}'