Skip to content

Commit

Permalink
Fix various code around Message.interaction(_metadata)
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed May 6, 2024
1 parent 0c35354 commit 2248fc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions discord/message.py
Expand Up @@ -715,7 +715,7 @@ def created_at(self) -> datetime.datetime:

@property
def original_response_message(self) -> Optional[Message]:
""":class:`~discord.Message`: The original response message if the message
"""Optional[:class:`~discord.Message`]: The original response message if the message
is a follow-up and is found in cache.
"""
if self.original_response_message_id:
Expand All @@ -724,7 +724,7 @@ def original_response_message(self) -> Optional[Message]:

@property
def interacted_message(self) -> Optional[Message]:
""":class:`~discord.Message`: The message that
"""Optional[:class:`~discord.Message`]: The message that
containes the interactive components, if applicable and is found in cache.
"""
if self.interacted_message_id:
Expand Down Expand Up @@ -2194,7 +2194,7 @@ def thread(self) -> Optional[Thread]:
return self._thread or self.guild.get_thread(self.id)

@property
@deprecated("This attribute is deprecated, please use Message.interaction_metadata instead.")
@deprecated('interaction_metadata')
def interaction(self) -> Optional[MessageInteraction]:
"""Optional[:class:`~discord.MessageInteraction`]: The interaction that this message is a response to.
Expand Down
4 changes: 2 additions & 2 deletions discord/ui/view.py
Expand Up @@ -667,8 +667,8 @@ def dispatch_view(self, component_type: int, custom_id: str, interaction: Intera
msg = interaction.message
if msg is not None:
message_id = msg.id
if msg.interaction:
interaction_id = msg.interaction.id
if msg.interaction_metadata:
interaction_id = msg.interaction_metadata.id

key = (component_type, custom_id)

Expand Down

0 comments on commit 2248fc1

Please sign in to comment.