Browse Source

chore: Update LayoutView.to_components()

pull/10166/head
DA-344 2 weeks ago
parent
commit
acd17d8713
  1. 6
      discord/ui/view.py

6
discord/ui/view.py

@ -785,9 +785,9 @@ class LayoutView(BaseView):
# sorted by row, which in LayoutView indicates the position of the component in the # sorted by row, which in LayoutView indicates the position of the component in the
# payload instead of in which ActionRow it should be placed on. # payload instead of in which ActionRow it should be placed on.
key = lambda i: i._rendered_row or i._row or sys.maxsize key = lambda i: (i._rendered_row or i._row or sys.maxsize) + 1
for _, cmps in groupby(self._children, key=key): for i in sorted(self._children, key=key):
components.extend(c.to_component_dict() for c in cmps) components.append(i.to_component_dict())
return components return components

Loading…
Cancel
Save