From 7ad73d020dc7bf0f2ee5e22365420051d8e9d66d Mon Sep 17 00:00:00 2001 From: DA344 <108473820+DA-344@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:06:58 +0100 Subject: [PATCH] Update discord/interactions.py Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/interactions.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index f39878082..07c600a5d 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -722,16 +722,16 @@ class InteractionCallback(Generic[ClientT]): self.type = try_enum(InteractionResponseType, resource['type']) - if 'message' in resource and resource['message']: + message = resource.get('message') + activity_instance = resource.get('activity_instance') + if message is not None: self.resource = InteractionMessage( state=self._state, channel=self._parent.channel, # type: ignore # channel should be the correct type here - data=resource['message'], - ) - elif 'activity_instance' in resource and resource['activity_instance']: - self.resource = InteractionCallbackActivityInstance( - resource['activity_instance'], + data=message, ) + elif activity_instance is not None: + self.resource = InteractionCallbackActivityInstance(activity_instance) def is_thinking(self) -> bool: """:class:`bool`: Whether the response was a thinking defer."""