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