mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-28 22:15:32 +00:00
Fix Section.accessory being MISSING
This commit is contained in:
parent
27d69e98e2
commit
59e28af19f
@ -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…
x
Reference in New Issue
Block a user