Browse Source

Fix various code around Message.interaction(_metadata)

pull/9821/head
Soheab 11 months ago
committed by GitHub
parent
commit
2248fc1946
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      discord/message.py
  2. 4
      discord/ui/view.py

6
discord/message.py

@ -715,7 +715,7 @@ class MessageInteractionMetadata(Hashable):
@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:
@ -724,7 +724,7 @@ class MessageInteractionMetadata(Hashable):
@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:
@ -2194,7 +2194,7 @@ class Message(PartialMessage, Hashable):
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.

4
discord/ui/view.py

@ -667,8 +667,8 @@ class ViewStore:
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)

Loading…
Cancel
Save