diff --git a/discord/ui/container.py b/discord/ui/container.py index d9eb4f35d..dab8f58ee 100644 --- a/discord/ui/container.py +++ b/discord/ui/container.py @@ -340,13 +340,7 @@ class Container(Item[V]): ------ TypeError An :class:`Item` was not passed. - ValueError - Maximum number of children has been exceeded (10). """ - - if len(self._children) >= 10: - raise ValueError('maximum number of children exceeded') - if not isinstance(item, Item): raise TypeError(f'expected Item not {item.__class__.__name__}') diff --git a/discord/ui/view.py b/discord/ui/view.py index 4de1d0766..2b72b8948 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -337,7 +337,7 @@ class BaseView: TypeError An :class:`Item` was not passed. ValueError - Maximum number of children has been exceeded (25), the + Maximum number of children has been exceeded, the row the item is trying to be added to is full or the item you tried to add is not allowed in this View. """ @@ -803,7 +803,7 @@ class LayoutView(BaseView): def add_item(self, item: Item[Any]) -> Self: if self.__total_children >= 40: - raise ValueError('maximum number of children exceeded') + raise ValueError('maximum number of children exceeded (40)') super().add_item(item) return self