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]
class _ApplicationCommandInteractionDataOptionOptional(TypedDict, total=False):
value: ApplicationCommandOptionType
class _ApplicationCommandInteractionDataOption(TypedDict):
name: str
class _ApplicationCommandInteractionDataOptionSubcommand(
_ApplicationCommandInteractionDataOption
):
type: Literal[1, 2]
options: List[ApplicationCommandInteractionDataOption]
class ApplicationCommandInteractionDataOption(
_ApplicationCommandInteractionDataOptionOptional
class _ApplicationCommandInteractionDataOptionString(
_ApplicationCommandInteractionDataOption
):
name: str
type: ApplicationCommandOptionType
type: Literal[3]
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):

Loading…
Cancel
Save