diff --git a/interactions/api/models/message.py b/interactions/api/models/message.py index 58dfc2e93..98873a883 100644 --- a/interactions/api/models/message.py +++ b/interactions/api/models/message.py @@ -1381,4 +1381,4 @@ async def disable_all_components(self) -> "Message": payload={"components": [component._json for component in self.components]}, ), _client=self._client, - ) \ No newline at end of file + ) diff --git a/interactions/client/context.py b/interactions/client/context.py index e4260de61..182fbf05c 100644 --- a/interactions/client/context.py +++ b/interactions/client/context.py @@ -846,3 +846,20 @@ def label(self) -> Optional[str]: for component in action_row.components: if component.custom_id == self.custom_id: return component.label + + @property + def component(self) -> Optional[Union[Button, SelectMenu]]: + """ + .. versionadded:: 4.4.0 + + The component that you interacted. + + :rtype: Optional[Union[Button, SelectMenu]] + """ + if self.message is None or self.message.components is None: + return + + for action_row in self.message.components: + for component in action_row.components: + if component.custom_id == self.custom_id: + return component