Skip to content

Commit 6473607

Browse files
authored
Add remove_image and remove_thumbnail methods.
1 parent f261b84 commit 6473607

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

discord/embeds.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,22 @@ def set_image(self: E, *, url: MaybeEmpty[Any]) -> E:
424424

425425
return self
426426

427+
def remove_image(self):
428+
"""Removes the embed's image.
429+
430+
This function returns the class instance to allow for fluent-style
431+
chaining.
432+
433+
.. versionadded:: 2.0
434+
"""
435+
try:
436+
del self._image
437+
except AttributeError:
438+
pass
439+
440+
return self
441+
442+
427443
@property
428444
def thumbnail(self) -> _EmbedMediaProxy:
429445
"""Returns an ``EmbedProxy`` denoting the thumbnail contents.
@@ -466,6 +482,21 @@ def set_thumbnail(self: E, *, url: MaybeEmpty[Any]) -> E:
466482

467483
return self
468484

485+
def remove_thumbnail(self):
486+
"""Removes the embed's thumbnail.
487+
488+
This function returns the class instance to allow for fluent-style
489+
chaining.
490+
491+
.. versionadded:: 2.0
492+
"""
493+
try:
494+
del self._thumbnail
495+
except AttributeError:
496+
pass
497+
498+
return self
499+
469500
@property
470501
def video(self) -> _EmbedVideoProxy:
471502
"""Returns an ``EmbedProxy`` denoting the video contents.

0 commit comments

Comments
 (0)