Browse Source

Fix typing of ApplicationCommandInteractionDataOption

pull/7136/head
Josh 4 years ago
committed by GitHub
parent
commit
39a674ddee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 48
      discord/types/interactions.py

48
discord/types/interactions.py

@ -93,16 +93,52 @@ class GuildApplicationCommandPermissions(PartialGuildApplicationCommandPermissio
InteractionType = Literal[1, 2, 3] InteractionType = Literal[1, 2, 3]
class _ApplicationCommandInteractionDataOptionOptional(TypedDict, total=False): class _ApplicationCommandInteractionDataOption(TypedDict):
value: ApplicationCommandOptionType name: str
class _ApplicationCommandInteractionDataOptionSubcommand(
_ApplicationCommandInteractionDataOption
):
type: Literal[1, 2]
options: List[ApplicationCommandInteractionDataOption] options: List[ApplicationCommandInteractionDataOption]
class ApplicationCommandInteractionDataOption( class _ApplicationCommandInteractionDataOptionString(
_ApplicationCommandInteractionDataOptionOptional _ApplicationCommandInteractionDataOption
): ):
name: str type: Literal[3]
type: ApplicationCommandOptionType value: str
class _ApplicationCommandInteractionDataOptionInteger(
_ApplicationCommandInteractionDataOption
):
type: Literal[4]
value: int
class _ApplicationCommandInteractionDataOptionBoolean(
_ApplicationCommandInteractionDataOption
):
type: Literal[5]
value: bool
class _ApplicationCommandInteractionDataOptionSnowflake(
_ApplicationCommandInteractionDataOption
):
type: Literal[6, 7, 8, 9]
value: Snowflake
ApplicationCommandInteractionDataOption = Union[
_ApplicationCommandInteractionDataOptionString,
_ApplicationCommandInteractionDataOptionInteger,
_ApplicationCommandInteractionDataOptionSubcommand,
_ApplicationCommandInteractionDataOptionBoolean,
_ApplicationCommandInteractionDataOptionSnowflake,
]
class ApplicationCommandResolvedPartialChannel(TypedDict): class ApplicationCommandResolvedPartialChannel(TypedDict):

Loading…
Cancel
Save