We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
component
ComponentContext
1 parent 800cdc1 commit 7c00cffCopy full SHA for 7c00cff
interactions/models/internal/context.py
@@ -780,6 +780,16 @@ async def edit_origin(
780
self.message_id = message.id
781
return message
782
783
+ @property
784
+ def component(self) -> typing.Optional[BaseComponent]:
785
+ """The component that was interacted with."""
786
+ if self.message is None or self.message.components is None:
787
+ return None
788
+ for action_row in self.message.components:
789
+ for component in action_row.components:
790
+ if component.custom_id == self.custom_id:
791
+ return component
792
+
793
794
class ModalContext(InteractionContext):
795
responses: dict[str, str]
0 commit comments