Browse Source

Fix Section.accessory being MISSING

pull/10273/head
Rapptz 7 days ago
parent
commit
59e28af19f
  1. 6
      discord/ui/section.py

6
discord/ui/section.py

@ -29,7 +29,7 @@ from typing import TYPE_CHECKING, Any, Dict, Generator, List, Literal, Optional,
from .item import Item from .item import Item
from .text_display import TextDisplay from .text_display import TextDisplay
from ..enums import ComponentType from ..enums import ComponentType
from ..utils import MISSING, get as _utils_get from ..utils import get as _utils_get
if TYPE_CHECKING: if TYPE_CHECKING:
from typing_extensions import Self from typing_extensions import Self
@ -242,8 +242,8 @@ class Section(Item[V]):
from .view import _component_to_item from .view import _component_to_item
# using MISSING as accessory so we can create the new one with the parent set # using MISSING as accessory so we can create the new one with the parent set
self = cls(id=component.id, accessory=MISSING) accessory = _component_to_item(component.accessory, None)
self.accessory = _component_to_item(component.accessory, self) self = cls(id=component.id, accessory=accessory)
self.id = component.id self.id = component.id
self._children = [_component_to_item(c, self) for c in component.children] self._children = [_component_to_item(c, self) for c in component.children]

Loading…
Cancel
Save