Skip to content

Commit

Permalink
Add remove_image and remove_thumbnail methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
izxxr authored Sep 5, 2021
1 parent f261b84 commit 6473607
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions discord/embeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,22 @@ def set_image(self: E, *, url: MaybeEmpty[Any]) -> E:

return self

def remove_image(self):
"""Removes the embed's image.
This function returns the class instance to allow for fluent-style
chaining.
.. versionadded:: 2.0
"""
try:
del self._image
except AttributeError:
pass

return self


@property
def thumbnail(self) -> _EmbedMediaProxy:
"""Returns an ``EmbedProxy`` denoting the thumbnail contents.
Expand Down Expand Up @@ -466,6 +482,21 @@ def set_thumbnail(self: E, *, url: MaybeEmpty[Any]) -> E:

return self

def remove_thumbnail(self):
"""Removes the embed's thumbnail.
This function returns the class instance to allow for fluent-style
chaining.
.. versionadded:: 2.0
"""
try:
del self._thumbnail
except AttributeError:
pass

return self

@property
def video(self) -> _EmbedVideoProxy:
"""Returns an ``EmbedProxy`` denoting the video contents.
Expand Down

0 comments on commit 6473607

Please sign in to comment.