Browse Source

chore: Make type the first key on to_components_dict

pull/10166/head
DA-344 5 months ago
parent
commit
bfae3a5183
  1. 2
      discord/components.py
  2. 2
      discord/ui/section.py

2
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,
}

2
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

Loading…
Cancel
Save