fix: Fix embed field parsing and adjust documentation.
@@ -669,7 +669,7 @@ class Embed(DictSerializerMixin):
:ivar Optional[EmbedImageStruct] video?: Video information
:ivar Optional[EmbedProvider] provider?: Provider information
:ivar Optional[EmbedAuthor] author?: Author information
- :ivar Optional[EmbedField] fields?: A list of fields denoting field information
+ :ivar Optional[List[EmbedField]] fields?: A list of fields denoting field information
"""
__slots__ = (
@@ -729,7 +729,7 @@ class Embed(DictSerializerMixin):
self.fields = (
[
EmbedField(**field) if isinstance(field, dict) else field
- for field in self._json["fields"][0]
+ for field in self._json["fields"]
]
if self._json.get("fields")
else None
@@ -743,7 +743,7 @@ class Embed(DictSerializerMixin):
# on we'll be refactoring this anyhow. What the fuck is breaking
# it?
if self.fields:
- self._json.update({"fields": [field._json for field in self.fields[0]]})
+ self._json.update({"fields": [field._json for field in self.fields]})
if self.author:
self._json.update({"author": self.author._json})
