allow passing EmptyEmbed to set_image and set_thumbnail
This commit is contained in:
		| @@ -276,15 +276,21 @@ class Embed: | ||||
|         This function returns the class instance to allow for fluent-style | ||||
|         chaining. | ||||
|  | ||||
|         .. versionchanged:: 1.4 | ||||
|             Passing :attr:`Empty` removes the image. | ||||
|  | ||||
|         Parameters | ||||
|         ----------- | ||||
|         url: :class:`str` | ||||
|             The source URL for the image. Only HTTP(S) is supported. | ||||
|         """ | ||||
|  | ||||
|         self._image = { | ||||
|             'url': str(url) | ||||
|         } | ||||
|         if url is EmptyEmbed: | ||||
|             del self._image | ||||
|         else: | ||||
|             self._image = { | ||||
|                 'url': str(url) | ||||
|             } | ||||
|  | ||||
|         return self | ||||
|  | ||||
| @@ -309,15 +315,21 @@ class Embed: | ||||
|         This function returns the class instance to allow for fluent-style | ||||
|         chaining. | ||||
|  | ||||
|         .. versionchanged:: 1.4 | ||||
|             Passing :attr:`Empty` removes the thumbnail. | ||||
|  | ||||
|         Parameters | ||||
|         ----------- | ||||
|         url: :class:`str` | ||||
|             The source URL for the thumbnail. Only HTTP(S) is supported. | ||||
|         """ | ||||
|  | ||||
|         self._thumbnail = { | ||||
|             'url': str(url) | ||||
|         } | ||||
|         if url is EmptyEmbed: | ||||
|             del self._thumbnail | ||||
|         else: | ||||
|             self._thumbnail = { | ||||
|                 'url': str(url) | ||||
|             } | ||||
|  | ||||
|         return self | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user