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