Browse Source

fix: is_persistent returning wrong values

pull/10166/head
DA-344 1 week ago
parent
commit
6e302a37ac
  1. 2
      discord/ui/action_row.py
  2. 2
      discord/ui/section.py

2
discord/ui/action_row.py

@ -205,7 +205,7 @@ class ActionRow(Item[V]):
return any(c.is_dispatchable() for c in self.children)
def is_persistent(self) -> bool:
return self.is_dispatchable() and all(c.is_persistent() for c in self.children)
return all(c.is_persistent() for c in self.children)
def _update_children_view(self, view: LayoutView) -> None:
for child in self._children:

2
discord/ui/section.py

@ -118,7 +118,7 @@ class Section(Item[V]):
return self.accessory.is_dispatchable()
def is_persistent(self) -> bool:
return self.is_dispatchable() and self.accessory.is_persistent()
return self.accessory.is_persistent()
def walk_children(self) -> Generator[Item[V], None, None]:
"""An iterator that recursively walks through all the children of this section.

Loading…
Cancel
Save