Skip to content

Commit

Permalink
refactor!: embed classes (#2063)
Browse files Browse the repository at this point in the history
Attributes for Author, Footer, Image, Thumbnail, Video, and Provider on the embed will now return `None` instead of `EmbedProxy`, when they are not set. This change is done for correct API reflection.

This allowed the complete removal of `EmbedProxy` in favour of separate classes for the above attributes. This allows for concrete typing support. The new classes are `EmbedAuthor`, `EmbedFooter`, `EmbedMedia` and `EmbedProxy`

`Embed.Empty` and `EmptyEmbed` have now been removed in favour of `None`

Co-Authored-By: Lulalaby <lala@pycord.dev>
  • Loading branch information
OmLanke and Lulalaby committed May 10, 2023
1 parent 5175fae commit 23da5e3
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 175 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ These changes are available on the `master` branch, but have not yet been releas
([#2036](https://github.com/Pycord-Development/pycord/pull/2036))
- Attributes shared between ext and slash commands are now dynamically fetched on bridge
commands. ([#1867](https://github.com/Pycord-Development/pycord/pull/1867))
- Embed attribues like author, footer, etc now return `None` when not set, and return
their respective classes when set.
([#2063](https://github.com/Pycord-Development/pycord/pull/2063))

### Removed

Expand All @@ -79,6 +82,8 @@ These changes are available on the `master` branch, but have not yet been releas
- Removed `view.message` being set when the view was sent by
`interaction.response.send_message`.
([#2036](https://github.com/Pycord-Development/pycord/pull/2036))
- Removed `Embed.Empty` in favour of `None`, and `EmbedProxy` in favour of individual
classes. ([#2063](https://github.com/Pycord-Development/pycord/pull/2063))

### Fixed

Expand Down

0 comments on commit 23da5e3

Please sign in to comment.