Implement Application Command Permissions models

This commit is contained in:
Soheab
2022-06-07 07:35:33 +02:00
committed by GitHub
parent 4e7529138c
commit 3aa55ba1ed
6 changed files with 217 additions and 87 deletions

View File

@ -62,6 +62,7 @@ __all__ = (
'EventStatus',
'AppCommandType',
'AppCommandOptionType',
'AppCommandPermissionType',
)
if TYPE_CHECKING:
@ -682,6 +683,12 @@ class AppCommandType(Enum):
message = 3
class AppCommandPermissionType(Enum):
role = 1
user = 2
channel = 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}'