From bfae3a5183b390ea05962d6144015a385bfe0079 Mon Sep 17 00:00:00 2001 From: DA-344 <108473820+DA-344@users.noreply.github.com> Date: Sun, 2 Mar 2025 17:13:08 +0100 Subject: [PATCH] chore: Make type the first key on to_components_dict --- discord/components.py | 2 +- discord/ui/section.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/components.py b/discord/components.py index fc9a77de8..4321d79dc 100644 --- a/discord/components.py +++ b/discord/components.py @@ -1018,9 +1018,9 @@ class FileComponent(Component): def to_dict(self) -> FileComponentPayload: return { + 'type': self.type.value, 'file': self.media.to_dict(), # type: ignore 'spoiler': self.spoiler, - 'type': self.type.value, } diff --git a/discord/ui/section.py b/discord/ui/section.py index c0dfbfae7..5a0ec7f27 100644 --- a/discord/ui/section.py +++ b/discord/ui/section.py @@ -174,8 +174,8 @@ class Section(Item[V]): def to_component_dict(self) -> Dict[str, Any]: data = { - 'components': [c.to_component_dict() for c in self._children], 'type': self.type.value, + 'components': [c.to_component_dict() for c in self._children], 'accessory': self.accessory.to_component_dict(), } return data