Skip to content

Commit 69badd8

Browse files
authored
fix separator
1 parent 04d748a commit 69badd8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

discord/ui/container.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ def add_item(self, item: Item) -> None:
8585
Maximum number of items has been exceeded (10).
8686
"""
8787

88-
if len(self.items) >= 10:
89-
raise ValueError("maximum number of children exceeded")
90-
9188
if not isinstance(item, Item):
9289
raise TypeError(f"expected Item not {item.__class__!r}")
9390

@@ -98,8 +95,7 @@ def add_item(self, item: Item) -> None:
9895
if item._underlying.is_v2():
9996
self._underlying.components.append(item._underlying)
10097
else:
101-
for i in range(len(self._underlying.components) - 1, 0, -1):
102-
row = self._underlying.components[i]
98+
for row in reversed(self._underlying.components):
10399
if (
104100
isinstance(row, ActionRow) and row.width + item.width <= 5
105101
): # If a valid ActionRow exists

discord/ui/separator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ def to_component_dict(self) -> SeparatorComponentPayload:
6262

6363
@classmethod
6464
def from_component(cls: type[S], component: SeparatorComponent) -> S:
65-
return cls(component.content)
65+
return cls(divider=component.divider, spacing=component.spacing)
6666

6767
callback = None

0 commit comments

Comments
 (0)