aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh <[email protected]>2021-08-10 22:36:37 +1000
committerGitHub <[email protected]>2021-08-10 08:36:37 -0400
commit5e800a726eb25fc7006f5634cd343faa897d6980 (patch)
treea1efed0f7f3c0f517d69c939e38504e902b3f2ac
parent[docs] Fix typo (diff)
downloaddiscord.py-5e800a726eb25fc7006f5634cd343faa897d6980.tar.xz
discord.py-5e800a726eb25fc7006f5634cd343faa897d6980.zip
[types] Add Application Command Type payloads
-rw-r--r--discord/types/interactions.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/discord/types/interactions.py b/discord/types/interactions.py
index bbed83f2..b0ce156b 100644
--- a/discord/types/interactions.py
+++ b/discord/types/interactions.py
@@ -37,8 +37,11 @@ if TYPE_CHECKING:
from .message import AllowedMentions, Message
+ApplicationCommandType = Literal[1, 2, 3]
+
class _ApplicationCommandOptional(TypedDict, total=False):
options: List[ApplicationCommandOption]
+ type: ApplicationCommandType
class ApplicationCommand(_ApplicationCommandOptional):
@@ -154,6 +157,8 @@ class ApplicationCommandInteractionDataResolved(TypedDict, total=False):
class _ApplicationCommandInteractionDataOptional(TypedDict, total=False):
options: List[ApplicationCommandInteractionDataOption]
resolved: ApplicationCommandInteractionDataResolved
+ target_id: Snowflake
+ type: ApplicationCommandType
class ApplicationCommandInteractionData(_ApplicationCommandInteractionDataOptional):
@@ -217,8 +222,15 @@ class MessageInteraction(TypedDict):
user: User
-class EditApplicationCommand(TypedDict):
- name: str
+
+
+
+class _EditApplicationCommandOptional(TypedDict, total=False):
description: str
options: Optional[List[ApplicationCommandOption]]
+ type: ApplicationCommandType
+
+
+class EditApplicationCommand(_EditApplicationCommandOptional):
+ name: str
default_permission: bool