forked from Pycord-Development/pycord
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
EmbedField
object to allow for easier embed class instance crea…
…tion (Pycord-Development#1181) * add EmbedField object to allow for easier embed class instance creation * add TypeError if `fields` setter is passed a list containing anything other than `EmbedField` objects * initial pass at removing proxy object reliance from embed fields * add self._fields to Embed.__init__ (prevents AttributeError) fix typing for fields parameter in Embed.__init__ fix typing for Embed.fields property change Embed.add_field, Embed.insert_field_at to use an EmbedField object when appending to Embed._fields change Embed.set_field_at to set EmbedField properties instead of dictionary values * add EmbedField to __all__ * fix init loop * fix init loop * fix to_dict for _fields attr * remove now-unused _EmbedFieldProxy class * add from_dict classmethod to EmbedField for better handling with Embed.from_dict * update EmbedField.from_dict to more closely match the behavior of Embed.from_dict * add Embed.append_field option to allow directly adding EmbedField objects without breaking Embed.add_field (similar to Select.append_option) * add EmbedField to docs * doc fix * add docstring for EmbedField.to_dict
- Loading branch information
Showing
2 changed files
with
135 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters