File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1381,4 +1381,4 @@ async def disable_all_components(self) -> "Message":
1381
1381
payload = {"components" : [component ._json for component in self .components ]},
1382
1382
),
1383
1383
_client = self ._client ,
1384
- )
1384
+ )
Original file line number Diff line number Diff line change @@ -846,3 +846,20 @@ def label(self) -> Optional[str]:
846
846
for component in action_row .components :
847
847
if component .custom_id == self .custom_id :
848
848
return component .label
849
+
850
+ @property
851
+ def component (self ) -> Optional [Union [Button , SelectMenu ]]:
852
+ """
853
+ .. versionadded:: 4.4.0
854
+
855
+ The component that you interacted.
856
+
857
+ :rtype: Optional[Union[Button, SelectMenu]]
858
+ """
859
+ if self .message is None or self .message .components is None :
860
+ return
861
+
862
+ for action_row in self .message .components :
863
+ for component in action_row .components :
864
+ if component .custom_id == self .custom_id :
865
+ return component
You can’t perform that action at this time.
0 commit comments