Skip to content

Commit 4faf842

Browse files
committed
fix: add missing attribs to modal context
1 parent 1380d9c commit 4faf842

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

interactions/models/internal/context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,13 +767,17 @@ async def edit_origin(
767767
class ModalContext(InteractionContext):
768768
responses: dict[str, str]
769769
"""The responses of the modal. The key is the `custom_id` of the component."""
770+
custom_id: str
771+
"""The developer defined custom ID of this modal"""
770772

771773
@classmethod
772774
def from_dict(cls, client: "interactions.Client", payload: dict) -> Self:
773775
instance = super().from_dict(client, payload)
774776
instance.responses = {
775777
comp["components"][0]["custom_id"]: comp["components"][0]["value"] for comp in payload["data"]["components"]
776778
}
779+
instance.kwargs = instance.responses
780+
instance.custom_id = payload["data"]["custom_id"]
777781
return instance
778782

779783

0 commit comments

Comments
 (0)