|
|
@ -46,7 +46,7 @@ class EmbedProxy: |
|
|
|
return len(self.__dict__) |
|
|
|
|
|
|
|
def __repr__(self) -> str: |
|
|
|
inner = ', '.join((f'{k}={v!r}' for k, v in self.__dict__.items() if not k.startswith('_'))) |
|
|
|
inner = ', '.join((f'{k}={getattr(self, k)!r}' for k in dir(self) if not k.startswith('_'))) |
|
|
|
return f'EmbedProxy({inner})' |
|
|
|
|
|
|
|
def __getattr__(self, attr: str) -> None: |
|
|
@ -57,10 +57,13 @@ class EmbedProxy: |
|
|
|
|
|
|
|
|
|
|
|
class EmbedMediaProxy(EmbedProxy): |
|
|
|
def __getattribute__(self, name: str) -> Any: |
|
|
|
if name == 'flags': |
|
|
|
return AttachmentFlags._from_value(self.__dict__.get('flags', 0)) |
|
|
|
return super().__getattribute__(name) |
|
|
|
def __init__(self, layer: Dict[str, Any]): |
|
|
|
super().__init__(layer) |
|
|
|
self._flags = self.__dict__.pop('flags', 0) |
|
|
|
|
|
|
|
@property |
|
|
|
def flags(self) -> AttachmentFlags: |
|
|
|
return AttachmentFlags._from_value(self._flags or 0) |
|
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|