aboutsummaryrefslogtreecommitdiff
path: root/discord/embeds.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-03-13 06:08:21 -0400
committerRapptz <[email protected]>2019-03-13 06:08:21 -0400
commit7fbdc6e83fccc7c3eb9c40087801e99d5a38211f (patch)
treee0f46950e60de0cca28bfa312703b62a0a129e1b /discord/embeds.py
parentAdd Embed.__len__ to query total character size of an embed. (diff)
downloaddiscord.py-7fbdc6e83fccc7c3eb9c40087801e99d5a38211f.tar.xz
discord.py-7fbdc6e83fccc7c3eb9c40087801e99d5a38211f.zip
Add Embed.copy to do a copy on an embed object.
Diffstat (limited to 'discord/embeds.py')
-rw-r--r--discord/embeds.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/embeds.py b/discord/embeds.py
index 663e9ea0..b756d55f 100644
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -169,6 +169,10 @@ class Embed:
return self
+ def copy(self):
+ """Returns a shallow copy of the embed."""
+ return Embed.from_dict(self.to_dict())
+
def __len__(self):
total = len(self.title) + len(self.description)
for field in getattr(self, '_fields', []):