mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
parent
1d5805ebcb
commit
ed1341012b
@ -63,6 +63,12 @@ class Embed:
|
|||||||
Returns the total size of the embed.
|
Returns the total size of the embed.
|
||||||
Useful for checking if it's within the 6000 character limit.
|
Useful for checking if it's within the 6000 character limit.
|
||||||
|
|
||||||
|
.. describe:: bool(b)
|
||||||
|
|
||||||
|
Returns whether the embed has any data set.
|
||||||
|
|
||||||
|
.. versionadded:: 2.0
|
||||||
|
|
||||||
Certain properties return an ``EmbedProxy``, a type
|
Certain properties return an ``EmbedProxy``, a type
|
||||||
that acts similar to a regular :class:`dict` except using dotted access,
|
that acts similar to a regular :class:`dict` except using dotted access,
|
||||||
e.g. ``embed.author.icon_url``. If the attribute
|
e.g. ``embed.author.icon_url``. If the attribute
|
||||||
@ -217,6 +223,22 @@ class Embed:
|
|||||||
|
|
||||||
return total
|
return total
|
||||||
|
|
||||||
|
def __bool__(self):
|
||||||
|
return any((
|
||||||
|
self.title,
|
||||||
|
self.url,
|
||||||
|
self.description,
|
||||||
|
self.colour,
|
||||||
|
self.fields,
|
||||||
|
self.timestamp,
|
||||||
|
self.author,
|
||||||
|
self.thumbnail,
|
||||||
|
self.footer,
|
||||||
|
self.image,
|
||||||
|
self.provider,
|
||||||
|
self.video,
|
||||||
|
))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def colour(self):
|
def colour(self):
|
||||||
return getattr(self, '_colour', EmptyEmbed)
|
return getattr(self, '_colour', EmptyEmbed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user