Browse Source

chore: run black

pull/10166/head
DA-344 3 months ago
parent
commit
67bfa57f32
  1. 4
      discord/ui/action_row.py
  2. 24
      discord/ui/view.py

4
discord/ui/action_row.py

@ -331,7 +331,6 @@ class ActionRow(Item[V]):
) -> SelectCallbackDecorator[V, UserSelectT]:
...
@overload
def select(
self,
@ -348,7 +347,6 @@ class ActionRow(Item[V]):
) -> SelectCallbackDecorator[V, RoleSelectT]:
...
@overload
def select(
self,
@ -365,7 +363,6 @@ class ActionRow(Item[V]):
) -> SelectCallbackDecorator[V, ChannelSelectT]:
...
@overload
def select(
self,
@ -484,6 +481,7 @@ class ActionRow(Item[V]):
@classmethod
def from_component(cls, component: ActionRowComponent) -> ActionRow:
from .view import _component_to_item
self = cls()
for cmp in component.children:
self.add_item(_component_to_item(cmp))

24
discord/ui/view.py

@ -750,7 +750,7 @@ class LayoutView(BaseView):
In order to modify and edit message components they must be
converted into a :class:`LayoutView` first.
Unlike :meth:`View.from_message` this works for
Unlike :meth:`View.from_message` this works for
Parameters
-----------
@ -822,15 +822,21 @@ class ViewStore:
self._dynamic_items[pattern] = item.__class__
elif item.is_dispatchable():
if getattr(item, '__discord_ui_container__', False):
is_fully_dynamic = item._update_store_data( # type: ignore
dispatch_info,
self._dynamic_items,
) or is_fully_dynamic
is_fully_dynamic = (
item._update_store_data( # type: ignore
dispatch_info,
self._dynamic_items,
)
or is_fully_dynamic
)
elif getattr(item, '__discord_ui_action_row__', False):
is_fully_dynamic = item._update_store_data( # type: ignore
dispatch_info,
self._dynamic_items,
) or is_fully_dynamic
is_fully_dynamic = (
item._update_store_data( # type: ignore
dispatch_info,
self._dynamic_items,
)
or is_fully_dynamic
)
else:
dispatch_info[(item.type.value, item.custom_id)] = item # type: ignore
is_fully_dynamic = False

Loading…
Cancel
Save