Skip to content

Commit

Permalink
feat(types): add Message.resolved payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Oct 7, 2023
1 parent 79a75d8 commit 3f365d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions disnake/types/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class InteractionDataResolved(TypedDict, total=False):
members: Dict[Snowflake, Member]
roles: Dict[Snowflake, Role]
channels: Dict[Snowflake, ResolvedPartialChannel]
# only in application commands


class ApplicationCommandInteractionDataResolved(InteractionDataResolved, total=False):
messages: Dict[Snowflake, Message]
attachments: Dict[Snowflake, Attachment]

Expand Down Expand Up @@ -157,7 +159,7 @@ class ApplicationCommandInteractionData(TypedDict):
id: Snowflake
name: str
type: ApplicationCommandType
resolved: NotRequired[InteractionDataResolved]
resolved: NotRequired[ApplicationCommandInteractionDataResolved]
options: NotRequired[List[ApplicationCommandInteractionDataOption]]
# this is the guild the command is registered to, not the guild the command was invoked in (see interaction.guild_id)
guild_id: NotRequired[Snowflake]
Expand Down
4 changes: 3 additions & 1 deletion disnake/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .components import Component
from .embed import Embed
from .emoji import PartialEmoji
from .interactions import InteractionMessageReference
from .interactions import InteractionDataResolved, InteractionMessageReference
from .member import Member, UserWithMember
from .snowflake import Snowflake, SnowflakeList
from .sticker import StickerItem
Expand Down Expand Up @@ -114,6 +114,8 @@ class Message(TypedDict):
sticker_items: NotRequired[List[StickerItem]]
position: NotRequired[int]
role_subscription_data: NotRequired[RoleSubscriptionData]
# contains resolved objects for `default_values` of select menus in this message; we currently don't have a use for this
resolved: NotRequired[InteractionDataResolved]

# specific to MESSAGE_CREATE/MESSAGE_UPDATE events
guild_id: NotRequired[Snowflake]
Expand Down

0 comments on commit 3f365d4

Please sign in to comment.